diff --git a/.github/workflows/generate_documentation.yml b/.github/workflows/generate_documentation.yml
index c3c4eced76b6..0f5480f5a2e3 100644
--- a/.github/workflows/generate_documentation.yml
+++ b/.github/workflows/generate_documentation.yml
@@ -7,7 +7,7 @@ on:
workflow_dispatch:
env:
- SPACEMAN_DMM_VERSION: suite-1.9
+ SPACEMAN_DMM_VERSION: suite-1.11
jobs:
generate_documentation:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 1c76565bc261..100cba7cc7d1 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,13 +14,13 @@ on:
workflow_dispatch:
env:
- BYOND_MAJOR: "515"
- BYOND_MINOR: "1647"
- SPACEMAN_DMM_VERSION: suite-1.9
+ BYOND_MAJOR: "516"
+ BYOND_MINOR: "1663"
+ SPACEMAN_DMM_VERSION: suite-1.11
jobs:
DreamChecker:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Cache
@@ -52,7 +52,7 @@ jobs:
chmod +x send.sh
./send.sh failure $WEBHOOK_URL
OpenDream:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Python setup
@@ -69,7 +69,7 @@ jobs:
- name: Run OpenDream
run: ./DMCompiler_linux-x64/DMCompiler nebula.dme --define=UNIT_TEST --suppress-unimplemented --skip-anything-typecheck --version=${BYOND_MAJOR}.${BYOND_MINOR} | bash test/annotate_od.sh
Code:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Cache
@@ -95,7 +95,7 @@ jobs:
chmod +x send.sh
./send.sh failure $WEBHOOK_URL
Maps:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
strategy:
matrix:
map_path: [example, tradeship, exodus, ministation, shaded_hills, karzerfeste, away_sites_testing, modpack_testing, planets_testing]
diff --git a/code/__defines/hydroponics.dm b/code/__defines/hydroponics.dm
index e40a83850d8b..9d0163f585e6 100644
--- a/code/__defines/hydroponics.dm
+++ b/code/__defines/hydroponics.dm
@@ -62,3 +62,9 @@
#define GROWTH_VINES "vines"
#define GROWTH_BIOMASS "mass"
#define GROWTH_MOLD "mold"
+
+#define PLANT_SEG_BODY "body" // Non-dissectable plants
+
+#define PLANT_STATE_FRESH "fresh"
+#define PLANT_STATE_ROASTED "roasted"
+#define PLANT_STATE_DRIED "dried"
diff --git a/code/__defines/tools.dm b/code/__defines/tools.dm
index 05931f41a2f4..4b0065e96b71 100644
--- a/code/__defines/tools.dm
+++ b/code/__defines/tools.dm
@@ -17,6 +17,7 @@
#define TOOL_PEN /decl/tool_archetype/pen
#define TOOL_STAMP /decl/tool_archetype/stamp
#define TOOL_SHEARS /decl/tool_archetype/shears
+#define TOOL_CHISEL /decl/tool_archetype/chisel
// Surgical tools.
#define TOOL_SCALPEL /decl/tool_archetype/scalpel
@@ -63,7 +64,7 @@
#define IS_HAMMER(A) IS_TOOL(A, TOOL_HAMMER)
#define IS_HOE(A) IS_TOOL(A, TOOL_HOE)
#define IS_SHEARS(A) IS_TOOL(A, TOOL_SHEARS)
-
+#define IS_CHISEL(A) IS_TOOL(A, TOOL_CHISEL)
#define IS_HEMOSTAT(A) IS_TOOL(A, TOOL_HEMOSTAT)
#define IS_RETRACTOR(A) IS_TOOL(A, TOOL_RETRACTOR)
diff --git a/code/__globals.dm b/code/__globals.dm
index ecb9b3eb1fc1..a328e0649715 100644
--- a/code/__globals.dm
+++ b/code/__globals.dm
@@ -1,7 +1,8 @@
// Defined here due to being used immediately below.
#define GET_DECL(D) (ispath(D, /decl) ? (decls_repository.fetched_decls[D] || decls_repository.get_decl(D)) : null)
#define IMPLIED_DECL GET_DECL(__IMPLIED_TYPE__)
-#define RESOLVE_TO_DECL(D) (istype(D, /decl) ? D : GET_DECL(D))
+#define RESOLVE_TO_DECL(D) (istype(D, /decl) ? D : (istext(D) ? decls_repository.get_decl_by_id(D, validate_decl_type = FALSE) : GET_DECL(D)))
+#define DECLS_ARE_EQUIVALENT(F, S) ((RESOLVE_TO_DECL(F) == RESOLVE_TO_DECL(S)))
// Defined here due to compile order; overrides in macros make the compiler complain.
/decl/global_vars
diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm
index 7e476912b248..942d9d9807f7 100644
--- a/code/_helpers/logging.dm
+++ b/code/_helpers/logging.dm
@@ -212,6 +212,8 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
return json_encode(d)
return d.get_log_info_line()
+var/global/_gag_report_progress = 0
/proc/report_progress(var/progress_message)
- admin_notice("[progress_message]", R_DEBUG)
- log_world(progress_message)
+ if(global._gag_report_progress <= 0)
+ admin_notice("[progress_message]", R_DEBUG)
+ to_world_log(progress_message)
diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm
index 269e7b986da1..a88092c9ae98 100644
--- a/code/_helpers/mobs.dm
+++ b/code/_helpers/mobs.dm
@@ -13,7 +13,8 @@
if(current_species)
var/decl/background_detail/background = current_species.get_default_background_datum_by_flag(BACKGROUND_FLAG_NAMING)
if(background)
- return background.get_random_name(null, gender)
+ return background.get_random_cultural_name(gender = gender, species = species)
+
return capitalize(pick(gender == FEMALE ? global.using_map.first_names_female : global.using_map.first_names_male)) + " " + capitalize(pick(global.using_map.last_names))
/proc/random_skin_tone(var/decl/bodytype/current_bodytype)
diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm
index 1c81acd2e27f..6b3c62d1249e 100644
--- a/code/_helpers/unsorted.dm
+++ b/code/_helpers/unsorted.dm
@@ -715,7 +715,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
Checks if that loc and dir has a item on the wall
*/
var/global/list/WALLITEMS = list(
- /obj/machinery/power/apc, /obj/machinery/alarm, /obj/item/radio/intercom,
+ /obj/machinery/apc, /obj/machinery/alarm, /obj/item/radio/intercom,
/obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank,
/obj/machinery/status_display, /obj/machinery/network/requests_console, /obj/machinery/light_switch, /obj/structure/sign,
/obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard,
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 36fc54d2f3fc..b0ab2d79e09a 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -158,7 +158,7 @@
Topic(src, list("command"="bolts", "activate" = "1"))
return TRUE
-/obj/machinery/power/apc/AICtrlClick(mob/living/silicon/user) // turns off/on APCs.
+/obj/machinery/apc/AICtrlClick(mob/living/silicon/user) // turns off/on APCs.
if(user.incapacitated())
return FALSE
Topic(src, list("breaker"="1"))
diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm
index ee1eba20b7cf..b9100b54ba30 100644
--- a/code/_onclick/cyborg.dm
+++ b/code/_onclick/cyborg.dm
@@ -121,7 +121,7 @@
/obj/machinery/door/airlock/BorgCtrlClick(mob/living/silicon/robot/user) // Bolts doors. Forwards to AI code.
return AICtrlClick(user)
-/obj/machinery/power/apc/BorgCtrlClick(mob/living/silicon/robot/user) // turns off/on APCs. Forwards to AI code.
+/obj/machinery/apc/BorgCtrlClick(mob/living/silicon/robot/user) // turns off/on APCs. Forwards to AI code.
return AICtrlClick(user)
/obj/machinery/turretid/BorgCtrlClick(mob/living/silicon/robot/user) //turret control on/off. Forwards to AI code.
diff --git a/code/_onclick/hud/hud_elements/hud_robot.dm b/code/_onclick/hud/hud_elements/hud_robot.dm
index 687d673f3a27..9c37069baa3a 100644
--- a/code/_onclick/hud/hud_elements/hud_robot.dm
+++ b/code/_onclick/hud/hud_elements/hud_robot.dm
@@ -1,5 +1,4 @@
/datum/hud/robot
- offset_hands_vertically = FALSE
gun_mode_toggle_type = /obj/screen/gun/mode
omit_hud_elements = list(
/decl/hud_element/health,
diff --git a/code/_onclick/hud/hud_types/_hud.dm b/code/_onclick/hud/hud_types/_hud.dm
index c14dcf7c378e..9e65b258399d 100644
--- a/code/_onclick/hud/hud_types/_hud.dm
+++ b/code/_onclick/hud/hud_types/_hud.dm
@@ -99,8 +99,6 @@
VAR_PRIVATE/obj/screen/gun/item/gun_item_use_toggle
VAR_PRIVATE/obj/screen/gun/radio/gun_radio_use_toggle
- var/offset_hands_vertically = TRUE
-
/datum/hud/New(mob/_owner)
if(istype(_owner))
owner = weakref(_owner)
@@ -353,30 +351,18 @@
qdel(inv_box)
// Rebuild offsets for the hand elements.
+ var/const/elems_per_row = 4
var/hand_y_offset = 21
var/list/elements = hud_elements_hands?.Copy()
- if(length(elements))
- if(offset_hands_vertically)
- while(length(elements))
- var/copy_index = min(length(elements), 2)+1
- var/list/sublist = elements.Copy(1, copy_index)
- elements.Cut(1, copy_index)
- var/obj/screen/inventory/inv_box
- if(length(sublist) == 1)
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER,BOTTOM:[hand_y_offset]"
- else
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER:-[world.icon_size/2],BOTTOM:[hand_y_offset]"
- inv_box = sublist[2]
- inv_box.screen_loc = "CENTER:[world.icon_size/2],BOTTOM:[hand_y_offset]"
- hand_y_offset += world.icon_size
- else
- var/hand_x_offset = -((length(elements) * world.icon_size) / 2) + (world.icon_size/2)
- for(var/obj/screen/inventory/inv_box in elements)
- inv_box.screen_loc = "CENTER:[hand_x_offset],BOTTOM:[hand_y_offset]"
- hand_x_offset += world.icon_size
- hand_y_offset += world.icon_size
+ while(length(elements))
+ var/copy_index = min(length(elements), elems_per_row)+1
+ var/list/sublist = elements.Copy(1, copy_index)
+ elements.Cut(1, copy_index)
+ var/hand_x_offset = (world.icon_size/2) * (1 - length(sublist))
+ for(var/obj/screen/inventory/inv_box in sublist)
+ inv_box.screen_loc = "CENTER:[hand_x_offset],BOTTOM:[hand_y_offset]"
+ hand_x_offset += world.icon_size
+ hand_y_offset += world.icon_size
if(mymob.client && islist(hud_elements_hands) && length(hud_elements_hands))
mymob.client.screen |= hud_elements_hands
diff --git a/code/controllers/subsystems/initialization/codex_dump.dm b/code/controllers/subsystems/initialization/codex_dump.dm
index b12dd686d78b..ee93934ea510 100644
--- a/code/controllers/subsystems/initialization/codex_dump.dm
+++ b/code/controllers/subsystems/initialization/codex_dump.dm
@@ -129,7 +129,7 @@ TODO: work out how to implement an external search function.
// Copied from del_the_world UT exceptions list.
var/static/list/skip_types = typesof(
/obj/item/organ/external/chest,
- /obj/machinery/power/apc,
+ /obj/machinery/apc,
/obj/machinery/alarm,
/obj/structure/stairs
)
diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm
index cdba384cdf85..bcf8a6922368 100644
--- a/code/controllers/subsystems/mapping.dm
+++ b/code/controllers/subsystems/mapping.dm
@@ -10,6 +10,7 @@ SUBSYSTEM_DEF(mapping)
var/list/submaps = list()
var/list/map_templates_by_category = list()
var/list/map_templates_by_type = list()
+ var/list/spawnable_map_templates = list()
var/list/banned_maps = list()
var/list/banned_template_names = list()
@@ -169,11 +170,15 @@ SUBSYSTEM_DEF(mapping)
map_templates = SSmapping.map_templates
map_templates_by_category = SSmapping.map_templates_by_category
map_templates_by_type = SSmapping.map_templates_by_type
+ spawnable_map_templates = SSmapping.spawnable_map_templates
/datum/controller/subsystem/mapping/proc/register_map_template(var/datum/map_template/map_template)
if(!validate_map_template(map_template) || !map_template.preload())
return FALSE
- map_templates[map_template.name] = map_template
+ map_templates[map_template.name] = map_template
+ map_templates_by_type[map_template.type] = map_template
+ if(map_template.is_spawnable)
+ spawnable_map_templates += map_template
for(var/temple_cat in map_template.template_categories) // :3
LAZYINITLIST(map_templates_by_category[temple_cat])
LAZYSET(map_templates_by_category[temple_cat], map_template.name, map_template)
diff --git a/code/datums/composite_sounds/_composite_sound.dm b/code/datums/composite_sounds/_composite_sound.dm
index 8a9f563910f9..c8b412c6c0a3 100644
--- a/code/datums/composite_sounds/_composite_sound.dm
+++ b/code/datums/composite_sounds/_composite_sound.dm
@@ -6,7 +6,7 @@
start_length (num) How long to wait before starting the main loop after playing start_sound
end_sound (soundfile) The sound played after the main loop has concluded
chance (num) Chance per loop to play a mid_sound
- volume (num) Sound output volume
+ play_volume (num) Sound output volume
max_loops (num) The max amount of loops to run for.
direct (bool) If true plays directly to provided atoms instead of from them
*/
@@ -19,7 +19,7 @@
var/start_length
var/end_sound
var/chance
- var/volume = 100
+ var/play_volume = 100
var/max_loops
var/direct
var/timerid
@@ -71,7 +71,7 @@
/datum/composite_sound/proc/play(soundfile)
var/sound/S = sound(soundfile)
for(var/atom/thing as anything in output_atoms)
- playsound(thing, S, volume)
+ playsound(thing, S, play_volume)
/datum/composite_sound/proc/get_sound(starttime, _mid_sounds)
. = _mid_sounds || mid_sounds
diff --git a/code/datums/composite_sounds/fire_sounds.dm b/code/datums/composite_sounds/fire_sounds.dm
index 348962238046..ae6d8d714380 100644
--- a/code/datums/composite_sounds/fire_sounds.dm
+++ b/code/datums/composite_sounds/fire_sounds.dm
@@ -11,7 +11,7 @@
)
mid_length = 10
end_sound = 'sound/ambience/firecrackle06.ogg'
- volume = 10
+ play_volume = 10
/datum/composite_sound/grill
start_sound = 'sound/machines/kitchen/grill/grill-start.ogg'
@@ -19,4 +19,4 @@
mid_sounds = list('sound/machines/kitchen/grill/grill-mid1.ogg'=10)
mid_length = 40
end_sound = 'sound/machines/kitchen/grill/grill-stop.ogg'
- volume = 50
+ play_volume = 50
diff --git a/code/datums/composite_sounds/loom.dm b/code/datums/composite_sounds/loom.dm
index 4661196c2896..3f5c525c1049 100644
--- a/code/datums/composite_sounds/loom.dm
+++ b/code/datums/composite_sounds/loom.dm
@@ -9,7 +9,7 @@
'sound/items/loom3.ogg'
)
end_sound = 'sound/items/loomstop.ogg'
- volume = 40
+ play_volume = 40
// Spinning wheel sampled from 'Wooden Spinning Wheel' by Kessir on freesound.org: https://freesound.org/people/kessir/sounds/414554/
/datum/composite_sound/spinning_wheel_working
@@ -22,4 +22,4 @@
'sound/items/spinningwheel3.ogg'
)
end_sound = 'sound/items/spinningwheelstop.ogg'
- volume = 60
\ No newline at end of file
+ play_volume = 60
\ No newline at end of file
diff --git a/code/datums/composite_sounds/machinery_sounds.dm b/code/datums/composite_sounds/machinery_sounds.dm
index d8a261cac346..e9247a13cf32 100644
--- a/code/datums/composite_sounds/machinery_sounds.dm
+++ b/code/datums/composite_sounds/machinery_sounds.dm
@@ -4,4 +4,4 @@
mid_sounds = list('sound/machines/microwave/microwave-mid1.ogg'=10, 'sound/machines/microwave/microwave-mid2.ogg'=1)
mid_length = 10
end_sound = 'sound/machines/microwave/microwave-end.ogg'
- volume = 1
\ No newline at end of file
+ play_volume = 1
\ No newline at end of file
diff --git a/code/datums/extensions/abilities/abilities_predator.dm b/code/datums/extensions/abilities/abilities_predator.dm
index 4fc37d4a8281..379316b3de80 100644
--- a/code/datums/extensions/abilities/abilities_predator.dm
+++ b/code/datums/extensions/abilities/abilities_predator.dm
@@ -56,23 +56,44 @@
to_chat(user, SPAN_WARNING("\The [victim] is too big for you to dismember."))
return TRUE
+ var/target_zone = user.get_target_zone()
+ var/obj/item/organ/external/limb = victim.get_organ(target_zone)
+ if(!limb)
+ to_chat(user, SPAN_WARNING("\The [victim] is missing that limb!"))
+ return TRUE
+
to_chat(user, SPAN_NOTICE("You dig into \the [victim], hunting for something edible."))
if(!do_after(user, max(2 SECONDS, victim.get_object_size() * 5), victim) || QDELETED(victim) || !victim.butchery_data || victim.stat != DEAD)
return TRUE
+ // Changing zone means we cancel.
+ if(target_zone != user.get_target_zone())
+ return
+
var/list/external_organs = victim.get_external_organs()
if(length(external_organs) <= 1)
user.visible_message(SPAN_DANGER("\The [user] tears \the [victim] apart!"))
victim.gib()
return TRUE
- var/obj/item/organ/external/limb = victim.get_organ(user.get_target_zone())
+ limb = victim.get_organ(target_zone) // In case it was removed in the interim.
if(!limb)
to_chat(user, SPAN_WARNING("\The [victim] is missing that limb!"))
return TRUE
- user.visible_message(SPAN_DANGER("\The [user] tears \the [limb] from \the [victim]!"))
- limb.dismember(FALSE, DISMEMBER_METHOD_EDGE, silent = TRUE)
- if(!QDELETED(limb))
- user.put_in_hands(limb)
+ if(length(limb.internal_organs))
+ var/obj/item/organ/internal/stolen = pick(limb.internal_organs)
+ user.visible_message(SPAN_DANGER("\The [user] tears \the [stolen] out of \the [victim]'s [limb.name]!"))
+ victim.remove_organ(stolen, TRUE, TRUE)
+ if(!QDELETED(stolen))
+ user.put_in_hands(stolen)
+ return TRUE
+
+ if(!(limb.limb_flags & ORGAN_FLAG_CAN_AMPUTATE))
+ to_chat(user, SPAN_WARNING("You gnaw on \the [victim]'s [limb.name], but can't pull it loose."))
+ else
+ user.visible_message(SPAN_DANGER("\The [user] tears \the [limb] from \the [victim]!"))
+ limb.dismember(FALSE, DISMEMBER_METHOD_EDGE, silent = TRUE)
+ if(!QDELETED(limb))
+ user.put_in_hands(limb)
return TRUE
diff --git a/code/datums/extensions/milkable/milkable.dm b/code/datums/extensions/milkable/milkable.dm
index 523a37e3e533..a377c2293ce9 100644
--- a/code/datums/extensions/milkable/milkable.dm
+++ b/code/datums/extensions/milkable/milkable.dm
@@ -85,7 +85,7 @@
to_chat(user, SPAN_WARNING("Wait for \the [critter] to stop moving before you try milking it."))
return TRUE
- if(container.reagents.total_volume >= container.volume)
+ if(REAGENTS_FREE_SPACE(container.reagents) <= 0)
to_chat(user, SPAN_WARNING("\The [container] is full."))
return TRUE
@@ -112,7 +112,7 @@
to_chat(user, SPAN_WARNING("\The [critter]'s udder is dry. Wait a little longer."))
return TRUE
- if(container.reagents.total_volume >= container.volume)
+ if(REAGENTS_FREE_SPACE(container.reagents) <= 0)
to_chat(user, SPAN_NOTICE("\The [container] is full."))
return TRUE
diff --git a/code/datums/music_tracks/_music_track.dm b/code/datums/music_tracks/_music_track.dm
index 290de89153a8..c1eba028164f 100644
--- a/code/datums/music_tracks/_music_track.dm
+++ b/code/datums/music_tracks/_music_track.dm
@@ -5,7 +5,7 @@
var/decl/license/license
var/song
var/url // Remember to include http:// or https:// or BYOND will be sad
- var/volume = 70
+ var/music_volume = 70
abstract_type = /decl/music_track
/decl/music_track/Initialize()
@@ -34,7 +34,7 @@
to_chat(listener, url)
to_chat(listener, "License: [license.name]")
- sound_to(listener, sound(song, repeat = 1, wait = 0, volume = volume, channel = sound_channels.lobby_channel))
+ sound_to(listener, sound(song, repeat = 1, wait = 0, volume = music_volume, channel = sound_channels.lobby_channel))
// No VV editing anything about music tracks
/decl/music_track/VV_static()
diff --git a/code/datums/repositories/atom_info.dm b/code/datums/repositories/atom_info.dm
index 9e842cf2feb0..a84f10736b76 100644
--- a/code/datums/repositories/atom_info.dm
+++ b/code/datums/repositories/atom_info.dm
@@ -9,79 +9,79 @@ var/global/repository/atom_info/atom_info_repository = new()
var/list/matter_mult_cache = list()
var/list/origin_tech_cache = list()
-/repository/atom_info/proc/create_key_for(var/path, var/material, var/amount)
- . = "[path]"
- if(ispath(path, /obj) && material) // only objects take material as an arg
- . = "[.]-[material]"
- if(ispath(path, /obj/item/stack) && !isnull(amount)) // similarly for stacks and amount
- . = "[.]-[amount]"
+/repository/atom_info/proc/create_key_for(var/_path, var/_mat, var/_amount)
+ . = "[_path]"
+ if(ispath(_path, /obj) && _mat) // only objects take material as an arg
+ . = "[.]-[_mat]"
+ if(ispath(_path, /obj/item/stack) && !isnull(_amount)) // similarly for stacks and amount
+ . = "[.]-[_amount]"
-/repository/atom_info/proc/get_instance_of(var/path, var/material, var/amount)
- if(ispath(path, /obj/item/stack))
- . = new path(null, amount, material)
- else if(ispath(path, /obj))
- . = new path(null, material)
+/repository/atom_info/proc/get_instance_of(var/_path, var/_mat, var/_amount)
+ if(ispath(_path, /obj/item/stack))
+ . = new _path(null, _amount, _mat)
+ else if(ispath(_path, /obj))
+ . = new _path(null, _mat)
else
- . = new path
+ . = new _path
-/repository/atom_info/proc/update_cached_info_for(var/path, var/material, var/amount, var/key)
+/repository/atom_info/proc/update_cached_info_for(var/_path, var/_mat, var/_amount, var/key)
var/atom/instance
if(!matter_cache[key])
- instance = get_instance_of(path, material, amount)
+ instance = get_instance_of(_path, _mat, _amount)
matter_cache[key] = instance.get_contained_matter() || list()
if(!combined_worth_cache[key])
- instance = instance || get_instance_of(path, material, amount)
+ instance = instance || get_instance_of(_path, _mat, _amount)
combined_worth_cache[key] = instance.get_combined_monetary_worth()
if(!single_worth_cache[key])
- instance = instance || get_instance_of(path, material, amount)
+ instance = instance || get_instance_of(_path, _mat, _amount)
single_worth_cache[key] = instance.get_single_monetary_worth()
if(!name_cache[key])
- instance = instance || get_instance_of(path, material, amount)
+ instance = instance || get_instance_of(_path, _mat, _amount)
name_cache[key] = instance.name
if(!description_cache[key])
- instance = instance || get_instance_of(path, material, amount)
+ instance = instance || get_instance_of(_path, _mat, _amount)
description_cache[key] = instance.desc
- if(!matter_mult_cache[key] && ispath(path, /obj))
- var/obj/obj_instance = instance || get_instance_of(path, material, amount)
+ if(!matter_mult_cache[key] && ispath(_path, /obj))
+ var/obj/obj_instance = instance || get_instance_of(_path, _mat, _amount)
matter_mult_cache[key] = obj_instance.get_matter_amount_modifier()
- if(!origin_tech_cache[key] && ispath(path, /obj/item))
- var/obj/item/item_instance = instance || get_instance_of(path, material, amount)
+ if(!origin_tech_cache[key] && ispath(_path, /obj/item))
+ var/obj/item/item_instance = instance || get_instance_of(_path, _mat, _amount)
origin_tech_cache[key] = cached_json_decode(item_instance.get_origin_tech())
if(!QDELETED(instance))
qdel(instance)
-/repository/atom_info/proc/get_matter_for(var/path, var/material, var/amount)
+/repository/atom_info/proc/get_matter_for(var/_path, var/_mat, var/_amount)
RETURN_TYPE(/list)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = matter_cache[key]
-/repository/atom_info/proc/get_combined_worth_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_combined_worth_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = combined_worth_cache[key]
-/repository/atom_info/proc/get_single_worth_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_single_worth_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = single_worth_cache[key]
-/repository/atom_info/proc/get_name_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_name_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = name_cache[key]
-/repository/atom_info/proc/get_description_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_description_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = description_cache[key]
-/repository/atom_info/proc/get_matter_multiplier_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_matter_multiplier_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = matter_mult_cache[key]
-/repository/atom_info/proc/get_origin_tech_for(var/path, var/material, var/amount)
- var/key = create_key_for(path, material, amount)
- update_cached_info_for(path, material, amount, key)
+/repository/atom_info/proc/get_origin_tech_for(var/_path, var/_mat, var/_amount)
+ var/key = create_key_for(_path, _mat, _amount)
+ update_cached_info_for(_path, _mat, _amount, key)
. = origin_tech_cache[key]
\ No newline at end of file
diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm
index 28dea46d5cd1..82476aae8e53 100644
--- a/code/datums/repositories/decls.dm
+++ b/code/datums/repositories/decls.dm
@@ -20,6 +20,12 @@
var/global/repository/decls/decls_repository = new
+/proc/resolve_decl_uid_list(list/decl_uids)
+ for(var/uid in decl_uids)
+ var/decl/decl = decls_repository.get_decl_by_id(uid)
+ if(istype(decl))
+ LAZYADD(., decl)
+
/repository/decls
var/list/fetched_decls = list()
var/list/fetched_decl_ids = list()
diff --git a/code/datums/trading/_trader.dm b/code/datums/trading/_trader.dm
index 097965789bd6..a62d75f584e5 100644
--- a/code/datums/trading/_trader.dm
+++ b/code/datums/trading/_trader.dm
@@ -41,7 +41,7 @@
if(ispath(name_language, /decl/language))
var/decl/language/L = GET_DECL(name_language)
if(istype(L))
- name = L.get_random_name(pick(MALE,FEMALE))
+ name = L.get_random_language_name(pick(MALE,FEMALE))
if(!name)
name = capitalize(pick(global.using_map.first_names_female + global.using_map.first_names_male)) + " " + capitalize(pick(global.using_map.last_names))
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 0beedbde9025..720499d4db30 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -46,7 +46,7 @@ var/global/list/areas = list()
var/has_gravity = TRUE
var/air_doors_activated = FALSE
- var/obj/machinery/power/apc/apc
+ var/obj/machinery/apc/apc
var/list/all_doors //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/list/ambience = list(
'sound/ambience/ambigen1.ogg',
@@ -459,9 +459,9 @@ var/global/list/mob/living/forced_ambiance_list = new
M.throw_at(T, maxrange, speed)
/area/proc/prison_break()
- var/obj/machinery/power/apc/theAPC = get_apc()
+ var/obj/machinery/apc/theAPC = get_apc()
if(theAPC && theAPC.operating)
- for(var/obj/machinery/power/apc/temp_apc in src)
+ for(var/obj/machinery/apc/temp_apc in src)
temp_apc.overload_lighting(70)
for(var/obj/machinery/door/airlock/temp_airlock in src)
temp_airlock.prison_open()
diff --git a/code/game/atom_material.dm b/code/game/atom_material.dm
index 7313f51691fa..91bfa983ba44 100644
--- a/code/game/atom_material.dm
+++ b/code/game/atom_material.dm
@@ -2,7 +2,7 @@
//Will we ever need to return more than one value here? Or should we just return the "dominant" material.
/atom/proc/get_material()
RETURN_TYPE(/decl/material)
- return
+ return material
//mostly for convenience
/atom/proc/get_material_type()
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index d6d80c68478b..18af0e9a1886 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -64,6 +64,15 @@
/// (FLOAT) world.time of last on_reagent_update call, used to prevent recursion due to reagents updating reagents
VAR_PRIVATE/_reagent_update_started = 0
+ /// (STRING) A color applied over the top of any material color. Implemented on /obj/item, /obj/structure and /turf.
+ var/paint_color
+
+ /// (DATUM) Reference to material decl. If set to a /decl/material path, will init the item with that material.
+ /// Implemented on /mob/living/exosuit, /turf/wall, /obj/item and /obj/structure
+ var/decl/material/material
+ /// (DATUM) Similar to above, but largely used by /turf/wall, /obj/structure and /obj/item/stack/material
+ var/decl/material/reinf_material
+
/atom/proc/get_max_health()
return max_health
diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm
index 0fa6f37889ec..22c582f53a8f 100644
--- a/code/game/base_turf.dm
+++ b/code/game/base_turf.dm
@@ -26,6 +26,12 @@
return A.base_turf
return get_base_turf(T.z)
+/proc/get_open_turf_type_by_area(var/turf/T)
+ if(!HasBelow(T.z))
+ return
+ var/area/area = get_area(T)
+ return area?.open_turf || T.open_turf_type
+
// Returns the open turf of a Z-stack by finding the nearest non-open turf below.
/proc/get_open_turf_type(var/turf/T)
if(!HasBelow(T.z))
diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm
index 49789e11e9af..0d9165d972fa 100644
--- a/code/game/gamemodes/events/power_failure.dm
+++ b/code/game/gamemodes/events/power_failure.dm
@@ -7,14 +7,14 @@
S.energy_fail(rand(15 * severity,30 * severity))
- for(var/obj/machinery/power/apc/C in SSmachines.machinery)
+ for(var/obj/machinery/apc/C in SSmachines.machinery)
if(!C.is_critical && (!affected_z_levels || (C.z in affected_z_levels)))
C.energy_fail(rand(30 * severity,60 * severity))
/proc/power_restore(var/announce = 1)
if(announce)
global.using_map.grid_restored_announcement()
- for(var/obj/machinery/power/apc/C in SSmachines.machinery)
+ for(var/obj/machinery/apc/C in SSmachines.machinery)
C.failure_timer = 0
var/obj/item/cell/cell = C.get_cell()
if(cell)
diff --git a/code/game/machinery/_machines_base/machinery.dm b/code/game/machinery/_machines_base/machinery.dm
index 5f03a9d4ba72..0a6de242520c 100644
--- a/code/game/machinery/_machines_base/machinery.dm
+++ b/code/game/machinery/_machines_base/machinery.dm
@@ -379,7 +379,7 @@ Class Procs:
if(electrocute_mob(user, get_area(src), src, 0.7))
var/area/temp_area = get_area(src)
if(temp_area)
- var/obj/machinery/power/apc/temp_apc = temp_area.get_apc()
+ var/obj/machinery/apc/temp_apc = temp_area.get_apc()
var/obj/machinery/power/terminal/terminal = temp_apc && temp_apc.terminal()
if(terminal && terminal.powernet)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 4e52cbc8c9c1..1770f09178cc 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -272,7 +272,7 @@
environment.merge(gas)
/obj/machinery/alarm/proc/overall_danger_level(var/datum/gas_mixture/environment)
- var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
+ var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.total_volume
var/environment_pressure = environment.return_pressure()
var/other_moles = 0
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index af152d8b5028..bb0801f80b5b 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -9,7 +9,7 @@
construct_state = /decl/machine_construction/pipe/welder
stat_immune = NOSCREEN | NOINPUT | NOPOWER
start_pressure = 45 ATM
- volume = 1000
+ gas_volume = 1000
interact_offline = TRUE
matter = list(
/decl/material/solid/metal/steel = 10 * SHEET_MATERIAL_AMOUNT
@@ -195,7 +195,7 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
if((air_contents.temperature > 0) && (pressure_delta > 0))
var/transfer_moles = calculate_transfer_moles(air_contents, environment, pressure_delta)
- transfer_moles = min(transfer_moles, (release_flow_rate/air_contents.volume)*air_contents.total_moles) //flow rate limit
+ transfer_moles = min(transfer_moles, (release_flow_rate/air_contents.total_volume)*air_contents.total_moles) //flow rate limit
pump_gas_passive(src, air_contents, environment, transfer_moles)
can_label = (air_contents?.return_pressure() < 1)
@@ -207,13 +207,13 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
/obj/machinery/portable_atmospherics/canister/proc/return_temperature()
var/datum/gas_mixture/GM = return_air()
- if(GM && GM.volume>0)
+ if(GM?.total_volume>0)
return GM.temperature
return 0
/obj/machinery/portable_atmospherics/canister/proc/return_pressure()
var/datum/gas_mixture/GM = return_air()
- if(GM && GM.volume>0)
+ if(GM?.total_volume>0)
return GM.return_pressure()
return 0
@@ -241,7 +241,7 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/transfer_moles = 0
if((air_contents.temperature > 0) && (pressure_delta > 0))
- transfer_moles = pressure_delta*thejetpack.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)//Actually transfer the gas
+ transfer_moles = pressure_delta*thejetpack.total_volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)//Actually transfer the gas
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
thejetpack.merge(removed)
to_chat(user, "You pulse-pressurize your jetpack from the tank.")
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 2958d2eab9ae..3de7c00f4368 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -6,7 +6,7 @@
var/datum/gas_mixture/air_contents = new
var/obj/item/tank/holding
- var/volume = 0
+ var/gas_volume = 0
var/destroyed = 0
var/start_pressure = ONE_ATMOSPHERE
@@ -19,7 +19,7 @@
/obj/machinery/portable_atmospherics/Initialize()
..()
- air_contents.volume = volume
+ air_contents.total_volume = gas_volume
air_contents.temperature = T20C
@@ -52,7 +52,7 @@
/decl/material/gas/nitrogen = N2STANDARD * MolesForPressure())
/obj/machinery/portable_atmospherics/proc/MolesForPressure(var/target_pressure = start_pressure)
- return (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
+ return (target_pressure * air_contents.total_volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
/obj/machinery/portable_atmospherics/on_update_icon()
return null
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 43297c50a477..492f0b0c26f5 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -15,7 +15,7 @@
var/pressuremin = 0
var/pressuremax = 10 ATM
- volume = 1000
+ gas_volume = 1000
power_rating = 7500 //7500 W ~ 10 HP
power_losses = 150
@@ -76,11 +76,11 @@
var/air_temperature
if(direction_out)
pressure_delta = target_pressure - environment.return_pressure()
- output_volume = environment.volume * environment.group_multiplier
+ output_volume = environment.total_volume * environment.group_multiplier
air_temperature = environment.temperature? environment.temperature : air_contents.temperature
else
pressure_delta = environment.return_pressure() - target_pressure
- output_volume = air_contents.volume * air_contents.group_multiplier
+ output_volume = air_contents.total_volume * air_contents.group_multiplier
air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index bf3c3498dda1..b6989e112bdd 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -10,7 +10,7 @@
movable_flags = MOVABLE_FLAG_WHEELED
var/volume_rate = 800
- volume = 750
+ gas_volume = 750
power_rating = 7500 //7500 W ~ 10 HP
power_losses = 150
@@ -67,7 +67,7 @@
else
environment = loc.return_air()
- var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles
+ var/transfer_moles = min(1, volume_rate/environment.total_volume)*environment.total_moles
power_draw = scrub_gas(src, scrubbing_gas, environment, air_contents, transfer_moles, power_rating)
@@ -151,7 +151,7 @@
name = "huge air scrubber"
icon_state = "scrubber:0"
anchored = TRUE
- volume = 50000
+ gas_volume = 50000
volume_rate = 5000
base_type = /obj/machinery/portable_atmospherics/powered/scrubber/huge
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index 75e0387142c4..59ef63bfc7c1 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -16,6 +16,8 @@
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
stat_immune = 0
+ chem_volume = 1000
+
var/processing = 0
var/obj/item/chems/glass/beaker = null
var/points = 0
@@ -54,7 +56,6 @@
/obj/item/stack/material/skin/mapped/synthleather =30))
/obj/machinery/biogenerator/Initialize()
- create_reagents(1000)
beaker = new /obj/item/chems/glass/bottle(src)
. = ..()
diff --git a/code/game/machinery/cracker.dm b/code/game/machinery/cracker.dm
index b3b31d1e54b0..2de58f1e211c 100644
--- a/code/game/machinery/cracker.dm
+++ b/code/game/machinery/cracker.dm
@@ -6,7 +6,7 @@
density = TRUE
anchored = TRUE
waterproof = TRUE
- volume = 5000
+ gas_volume = 5000
use_power = POWER_USE_IDLE
idle_power_usage = 100
active_power_usage = 10000
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 8c44f0f99c0b..b19b2f20f189 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -15,14 +15,12 @@
icon_state = "preview"
power_channel = ENVIRON
interact_offline = FALSE
-
explosion_resistance = 10
-
base_type = /obj/machinery/door/airlock
frame_type = /obj/structure/door_assembly
-
icon_state_open = "open"
icon_state_closed = "closed"
+ material = /decl/material/solid/metal/steel
var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/hackProof = 0 // if 1, this door can't be hacked by the AI
@@ -42,7 +40,7 @@
var/aiDisabledIdScanner = 0
var/aiHacking = 0
autoclose = 1
- var/mineral = null
+
var/justzap = 0
var/safe = 1
var/speaker = 1
@@ -75,29 +73,21 @@
var/stripe_color = null
var/symbol_color = null
var/window_color = null
- var/window_material = /decl/material/solid/glass
-
- var/fill_file = 'icons/obj/doors/station/fill_steel.dmi'
- var/color_file = 'icons/obj/doors/station/color.dmi'
- var/color_fill_file = 'icons/obj/doors/station/fill_color.dmi'
- var/stripe_file = 'icons/obj/doors/station/stripe.dmi'
- var/stripe_fill_file = 'icons/obj/doors/station/fill_stripe.dmi'
- var/glass_file = 'icons/obj/doors/station/fill_glass.dmi'
- var/bolts_file = 'icons/obj/doors/station/lights_bolts.dmi'
- var/deny_file = 'icons/obj/doors/station/lights_deny.dmi'
- var/lights_file = 'icons/obj/doors/station/lights_green.dmi'
- var/panel_file = 'icons/obj/doors/station/panel.dmi'
- var/sparks_damaged_file = 'icons/obj/doors/station/sparks_damaged.dmi'
- var/sparks_broken_file = 'icons/obj/doors/station/sparks_broken.dmi'
- var/welded_file = 'icons/obj/doors/station/welded.dmi'
- var/emag_file = 'icons/obj/doors/station/emag.dmi'
-/obj/machinery/door/airlock/get_material()
- RETURN_TYPE(/decl/material)
- return GET_DECL(mineral ? mineral : /decl/material/solid/metal/steel)
-
-/obj/machinery/door/airlock/proc/get_window_material()
- return GET_DECL(window_material)
+ var/fill_file = 'icons/obj/doors/station/fill_steel.dmi'
+ var/color_file = 'icons/obj/doors/station/color.dmi'
+ var/color_fill_file = 'icons/obj/doors/station/fill_color.dmi'
+ var/stripe_file = 'icons/obj/doors/station/stripe.dmi'
+ var/stripe_fill_file = 'icons/obj/doors/station/fill_stripe.dmi'
+ var/glass_file = 'icons/obj/doors/station/fill_glass.dmi'
+ var/bolts_file = 'icons/obj/doors/station/lights_bolts.dmi'
+ var/deny_file = 'icons/obj/doors/station/lights_deny.dmi'
+ var/lights_file = 'icons/obj/doors/station/lights_green.dmi'
+ var/panel_file = 'icons/obj/doors/station/panel.dmi'
+ var/sparks_damaged_file = 'icons/obj/doors/station/sparks_damaged.dmi'
+ var/sparks_broken_file = 'icons/obj/doors/station/sparks_broken.dmi'
+ var/welded_file = 'icons/obj/doors/station/welded.dmi'
+ var/emag_file = 'icons/obj/doors/station/emag.dmi'
/obj/machinery/door/airlock/Process()
if(main_power_lost_until > 0 && world.time >= main_power_lost_until)
@@ -324,15 +314,15 @@ About the new airlock wires panel:
set_light(0)
- if(door_color && !(door_color == "none"))
+ if(door_color)
var/ikey = "[airlock_type]-[door_color]-color"
color_overlay = airlock_icon_cache["[ikey]"]
if(!color_overlay)
color_overlay = new(color_file)
color_overlay.Blend(door_color, ICON_MULTIPLY)
airlock_icon_cache["[ikey]"] = color_overlay
- if(glass)
- if (window_color && window_color != "none")
+ if(reinf_material)
+ if (window_color)
var/ikey = "[airlock_type]-[window_color]-windowcolor"
filling_overlay = airlock_icon_cache["[ikey]"]
if (!filling_overlay)
@@ -342,7 +332,7 @@ About the new airlock wires panel:
else
filling_overlay = glass_file
else
- if(door_color && !(door_color == "none"))
+ if(door_color)
var/ikey = "[airlock_type]-[door_color]-fillcolor"
filling_overlay = airlock_icon_cache["[ikey]"]
if(!filling_overlay)
@@ -866,9 +856,8 @@ About the new airlock wires panel:
var/obj/structure/door_assembly/da = ..() // Note that we're deleted here already. Don't do unsafe stuff.
. = da
- if(mineral)
- da.glass_material = mineral
- da.glass = 1
+ if(da.can_install_glass)
+ da.reinf_material = reinf_material
da.paintable = paintable
da.door_color = door_color
@@ -1026,6 +1015,10 @@ About the new airlock wires panel:
return ..(M)
/obj/machinery/door/airlock/Initialize(var/mapload, var/d, var/populate_parts = TRUE, obj/structure/door_assembly/assembly = null)
+
+ material = RESOLVE_TO_DECL(material)
+ reinf_material = RESOLVE_TO_DECL(reinf_material)
+
. = ..()
//wires
@@ -1048,27 +1041,22 @@ About the new airlock wires panel:
else if(!begins_closed)
queue_icon_update()
- if (glass)
+ if(reinf_material)
paintable |= PAINT_WINDOW_PAINTABLE
- if (!window_color)
- var/decl/material/window = get_window_material()
- window_color = window.color
+ paint_window(reinf_material.color)
/obj/machinery/door/airlock/inherit_from_assembly(obj/structure/door_assembly/assembly)
//if assembly is given, create the new door from the assembly
if (..(assembly))
- var/decl/material/mat = GET_DECL(assembly.glass_material)
-
- if(assembly.glass == 1) // supposed to use material in this case
- mineral = assembly.glass_material
- if(mat.opacity <= 0.7)
- glass = TRUE
+ if(assembly.reinf_material && assembly.can_install_glass)
+ material = assembly.reinf_material
+ if(assembly.reinf_material.opacity <= 0.7)
set_opacity(0)
hitsound = 'sound/effects/Glasshit.ogg'
max_health = 300
explosion_resistance = 5
else
- door_color = mat.color
+ door_color = assembly.reinf_material.color
else
door_color = assembly.door_color
@@ -1076,7 +1064,7 @@ About the new airlock wires panel:
if(assembly.created_name)
SetName(assembly.created_name)
else
- SetName("[mineral ? "[mat.solid_name || mat.name] airlock" : assembly.base_name]")
+ SetName("[material ? "[material.solid_name || material.name] airlock" : assembly.base_name]")
paintable = assembly.paintable
stripe_color = assembly.stripe_color
@@ -1149,9 +1137,8 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/proc/paint_window(new_color)
if (new_color)
window_color = new_color
- else if (window_material)
- var/decl/material/window = get_window_material()
- window_color = window.color
+ else if (reinf_material)
+ window_color = reinf_material.color
else
window_color = GLASS_COLOR
queue_icon_update()
diff --git a/code/game/machinery/doors/airlock_subtypes.dm b/code/game/machinery/doors/airlock_subtypes.dm
index b3474720a5f6..f2eda23a2f77 100644
--- a/code/game/machinery/doors/airlock_subtypes.dm
+++ b/code/game/machinery/doors/airlock_subtypes.dm
@@ -11,7 +11,6 @@
stripe_color = COLOR_NT_RED
/obj/machinery/door/airlock/engineering
- name = "Maintenance Hatch"
door_color = COLOR_AMBER
/obj/machinery/door/airlock/medical
@@ -27,7 +26,6 @@
stripe_color = COLOR_GREEN
/obj/machinery/door/airlock/mining
- name = "Mining Airlock"
door_color = COLOR_PALE_ORANGE
stripe_color = COLOR_BEASTY_BROWN
@@ -53,24 +51,20 @@
stripe_color = COLOR_GRAY20
/obj/machinery/door/airlock/freezer
- name = "Freezer Airlock"
door_color = COLOR_WHITE
/obj/machinery/door/airlock/maintenance
- name = "Maintenance Access"
stripe_color = COLOR_AMBER
// Glass airlock presets
-
/obj/machinery/door/airlock/glass
- name = "Glass Airlock"
icon_state = "preview_glass"
hitsound = 'sound/effects/Glasshit.ogg'
max_health = 300
explosion_resistance = 5
opacity = FALSE
- glass = TRUE
+ reinf_material = /decl/material/solid/glass
/obj/machinery/door/airlock/glass/command
door_color = COLOR_COMMAND_BLUE
@@ -120,7 +114,6 @@
door_color = COLOR_WHITE
/obj/machinery/door/airlock/glass/maintenance
- name = "Maintenance Access"
stripe_color = COLOR_AMBER
/obj/machinery/door/airlock/glass/civilian
@@ -130,8 +123,7 @@
// External airlock presets
/obj/machinery/door/airlock/external
- airlock_type = "External"
- name = "External Airlock"
+ airlock_type = "external"
icon = 'icons/obj/doors/external/door.dmi'
fill_file = 'icons/obj/doors/external/fill_steel.dmi'
color_file = 'icons/obj/doors/external/color.dmi'
@@ -160,7 +152,6 @@
LAZYADD(., access_external_airlocks)
/obj/machinery/door/airlock/external/escapepod
- name = "Escape Pod"
locked = TRUE
/obj/machinery/door/airlock/external/escapepod/attackby(obj/item/used_item, mob/user)
@@ -210,14 +201,12 @@
/obj/machinery/door/airlock/centcom
airlock_type = "centcomm"
- name = "\improper Airlock"
icon = 'icons/obj/doors/centcomm/door.dmi'
fill_file = 'icons/obj/doors/centcomm/fill_steel.dmi'
paintable = PAINT_PAINTABLE|PAINT_STRIPABLE
/obj/machinery/door/airlock/highsecurity
airlock_type = "secure"
- name = "Secure Airlock"
icon = 'icons/obj/doors/secure/door.dmi'
fill_file = 'icons/obj/doors/secure/fill_steel.dmi'
explosion_resistance = 20
@@ -232,7 +221,6 @@
/obj/machinery/door/airlock/hatch
airlock_type = "hatch"
- name = "\improper Airtight Hatch"
icon = 'icons/obj/doors/hatch/door.dmi'
fill_file = 'icons/obj/doors/hatch/fill_steel.dmi'
stripe_file = 'icons/obj/doors/hatch/stripe.dmi'
@@ -249,7 +237,6 @@
paintable = PAINT_STRIPABLE
/obj/machinery/door/airlock/hatch/maintenance
- name = "Maintenance Hatch"
stripe_color = COLOR_AMBER
/obj/machinery/door/airlock/hatch/maintenance/bolted
@@ -257,7 +244,6 @@
/obj/machinery/door/airlock/vault
airlock_type = "vault"
- name = "Vault"
icon = 'icons/obj/doors/vault/door.dmi'
fill_file = 'icons/obj/doors/vault/fill_steel.dmi'
explosion_resistance = 20
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index ca111e877bcf..830d9f241672 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -36,7 +36,6 @@
//turning this off prevents awkward zone geometry in places like medbay lobby, for example.
block_air_zones = 0
- var/decl/material/implicit_material
autoset_access = FALSE // Uses different system with buttons.
pry_mod = 1.35
@@ -54,7 +53,7 @@
base_type = /obj/machinery/door/blast
/obj/machinery/door/blast/Initialize()
- implicit_material = GET_DECL(/decl/material/solid/metal/plasteel)
+ material = GET_DECL(/decl/material/solid/metal/plasteel)
. = ..()
/obj/machinery/door/blast/get_examine_strings(mob/user, distance, infix, suffix)
@@ -137,10 +136,6 @@
else
force_close()
-/obj/machinery/door/blast/get_material()
- RETURN_TYPE(/decl/material)
- return implicit_material
-
// Proc: attackby()
// Parameters: 2 (used_item - Item this object was clicked with, user - Mob which clicked this object)
// Description: If we are clicked with crowbar or wielded fire axe, try to manually open the door.
diff --git a/code/game/machinery/doors/double.dm b/code/game/machinery/doors/double.dm
index 4bfc77f73631..134f2a3ef11d 100644
--- a/code/game/machinery/doors/double.dm
+++ b/code/game/machinery/doors/double.dm
@@ -84,7 +84,6 @@
door_color = COLOR_NT_RED
/obj/machinery/door/airlock/double/engineering
- name = "Maintenance Hatch"
door_color = COLOR_AMBER
/obj/machinery/door/airlock/double/medical
@@ -96,7 +95,6 @@
stripe_color = COLOR_GREEN
/obj/machinery/door/airlock/double/mining
- name = "Mining Airlock"
door_color = COLOR_PALE_ORANGE
stripe_color = COLOR_BEASTY_BROWN
@@ -116,18 +114,15 @@
door_color = COLOR_BLUE_GRAY
/obj/machinery/door/airlock/double/maintenance
- name = "Maintenance Access"
stripe_color = COLOR_AMBER
/obj/machinery/door/airlock/double/civilian
stripe_color = COLOR_CIVIE_GREEN
/obj/machinery/door/airlock/double/freezer
- name = "Freezer Airlock"
door_color = COLOR_WHITE
/obj/machinery/door/airlock/double/glass
- name = "Glass Airlock"
opacity = FALSE
glass = TRUE
@@ -175,7 +170,6 @@
door_color = COLOR_WHITE
/obj/machinery/door/airlock/double/glass/maintenance
- name = "Maintenance Access"
stripe_color = COLOR_AMBER
/obj/machinery/door/airlock/double/glass/civilian
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index f39b5849a088..57c7d8feb451 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -6,7 +6,6 @@
min_force = 4
hitsound = 'sound/effects/Glasshit.ogg'
max_health = 150 //If you change this, consider changing ../door/window/brigdoor/ health at the bottom of this .dm file
- current_health = 150
visible = 0.0
use_power = POWER_USE_OFF
stat_immune = NOSCREEN | NOINPUT | NOPOWER
@@ -213,11 +212,9 @@
icon = 'icons/obj/doors/windoor.dmi'
icon_state = "leftsecure"
base_state = "leftsecure"
- max_health = 300
- current_health = 300.0 //Stronger doors for prison (regular window door health is 150)
+ max_health = 300 //Stronger doors for prison (regular window door health is 150)
pry_mod = 0.65
-
/obj/machinery/door/window/northleft
dir = NORTH
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 530e66903cbb..85a6ad930679 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -17,7 +17,7 @@
construct_state = /decl/machine_construction/default/panel_closed
var/playing = 0
- var/volume = 20
+ var/music_volume = 20
var/sound_id
var/datum/sound_token/sound_token
@@ -84,7 +84,7 @@
"current_track" = current_track != null ? current_track.title : "No track selected",
"playing" = playing,
"tracks" = juke_tracks,
- "volume" = volume
+ "volume" = music_volume
)
ui = SSnano.try_update_ui(user, src, ui_key, ui, data, force_open)
@@ -180,12 +180,12 @@
return
// Jukeboxes cheat massively and actually don't share id. This is only done because it's music rather than ambient noise.
- sound_token = play_looping_sound(src, sound_id, current_track.GetTrack(), volume = volume, range = 7, falloff = 3, prefer_mute = TRUE, preference = /datum/client_preference/play_game_music, streaming = TRUE)
+ sound_token = play_looping_sound(src, sound_id, current_track.GetTrack(), volume = music_volume, range = 7, falloff = 3, prefer_mute = TRUE, preference = /datum/client_preference/play_game_music, streaming = TRUE)
playing = 1
update_use_power(POWER_USE_ACTIVE)
/obj/machinery/media/jukebox/proc/AdjustVolume(var/new_volume)
- volume = clamp(new_volume, 0, 50)
+ music_volume = clamp(new_volume, 0, 50)
if(sound_token)
- sound_token.SetVolume(volume)
+ sound_token.SetVolume(music_volume)
diff --git a/code/game/machinery/kitchen/drying_oven.dm b/code/game/machinery/kitchen/drying_oven.dm
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/code/game/machinery/kitchen/icecream.dm b/code/game/machinery/kitchen/icecream.dm
index 9671e16e3614..f4a52486e668 100644
--- a/code/game/machinery/kitchen/icecream.dm
+++ b/code/game/machinery/kitchen/icecream.dm
@@ -18,6 +18,7 @@
anchored = FALSE
atom_flags = ATOM_FLAG_NO_CHEM_CHANGE | ATOM_FLAG_OPEN_CONTAINER
idle_power_usage = 100
+ chem_volume = 100
var/list/product_types = list()
var/dispense_flavour = ICECREAM_VANILLA
@@ -66,14 +67,9 @@
/obj/machinery/icecream_vat/Initialize(mapload, d, populate_parts)
. = ..()
- initialize_reagents()
while(product_types.len < 8)
product_types.Add(5)
-/obj/machinery/icecream_vat/initialize_reagents(populate = TRUE)
- create_reagents(100)
- . = ..()
-
/obj/machinery/icecream_vat/populate_reagents()
add_to_reagents(/decl/material/liquid/drink/milk, 5)
add_to_reagents(/decl/material/liquid/nutriment/flour, 5)
@@ -201,7 +197,7 @@
icon_state = "icecream_cone_waffle" //default for admin-spawned cones, href_list["cone"] should overwrite this all the time
layer = ABOVE_OBJ_LAYER
bitesize = 3
- volume = 20
+ chem_volume = 20
nutriment_amt = 5
nutriment_type = /decl/material/liquid/nutriment
nutriment_desc = list("crunchy waffle cone" = 1)
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index f1b754a8920e..1455ec5907ac 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -11,6 +11,8 @@
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
stat_immune = 0
+ chem_volume = 100
+
var/operating = FALSE // Is it on?
var/dirty = 0 // = {0..100} Does it need cleaning?
var/broken = 0 // ={0,1,2} How broken is it???
@@ -37,7 +39,6 @@
/obj/machinery/microwave/Initialize()
. = ..()
- create_reagents(100)
soundloop = new(list(src), FALSE)
/obj/machinery/microwave/Destroy()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 005f27ca3465..34843e14fd26 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -168,4 +168,4 @@ Buildable meters
icon = 'icons/obj/objects.dmi'
icon_state = "floor_beacon" // If anyone wants to make better sprite, feel free to do so without asking me.
w_class = ITEM_SIZE_NORMAL
- build_type = /obj/machinery/power/sensor
\ No newline at end of file
+ build_type = /obj/machinery/power_sensor
\ No newline at end of file
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index 56e7c788416d..13bf81ae5e2d 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -104,32 +104,6 @@
name = "wall-mounted relay kit"
desc = "An all-in-one wall-mounted relay kit, comes preassembled."
-/obj/item/frame/light
- name = "light fixture frame"
- desc = "Used for building lights."
- icon = 'icons/obj/lighting.dmi'
- icon_state = "tube-construct-item"
- build_machine_type = /obj/machinery/light
- reverse = 1
-
-/obj/item/frame/light/small
- name = "small light fixture frame"
- icon_state = "bulb-construct-item"
- material = /decl/material/solid/metal/steel
- build_machine_type = /obj/machinery/light/small
-
-/obj/item/frame/light/spot
- name = "spotlight fixture frame"
- icon_state = "tube-construct-item"
- material = /decl/material/solid/metal/steel
- build_machine_type = /obj/machinery/light/spot
-
-/obj/item/frame/light/nav
- name = "navigation light fixture frame"
- icon_state = "tube-construct-item"
- material = /decl/material/solid/metal/steel
- build_machine_type = /obj/machinery/light/navigation
-
/obj/item/frame/button
name = "button frame"
icon = 'icons/obj/objects.dmi'
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index f6e04eb2d50f..1113f10ec678 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -19,6 +19,7 @@
obj_flags = OBJ_FLAG_ANCHORABLE
clicksound = "button"
clickvol = 40
+ chem_volume = 100
// Power
idle_power_usage = 10
@@ -57,10 +58,6 @@
)
return wash_blacklist
-/obj/machinery/washing_machine/Initialize(mapload, d, populate_parts)
- create_reagents(100)
- . = ..()
-
/obj/machinery/washing_machine/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
. += SPAN_NOTICE("The detergent port is [atom_flags & ATOM_FLAG_OPEN_CONTAINER ? "open" : "closed"].")
diff --git a/code/game/movietitles.dm b/code/game/movietitles.dm
index 7afbacf338d8..90f5287221f8 100644
--- a/code/game/movietitles.dm
+++ b/code/game/movietitles.dm
@@ -80,12 +80,12 @@ var/global/list/end_titles
background = GET_DECL(/decl/background_detail/heritage/human)
if(!showckey)
if(prob(90))
- chunk += "[background.get_random_name(H, H.gender)]\t \t \t \t[uppertext(used_name)][job]"
+ chunk += "[background.get_random_cultural_name(H, H.gender, H.get_species())]\t \t \t \t[uppertext(used_name)][job]"
else
var/decl/pronouns/pronouns = H.get_pronouns()
chunk += "[used_name]\t \t \t \t[uppertext(pronouns.him)]SELF"
else
- chunk += "[uppertext(background.get_random_name(H, H.gender))] a.k.a. '[uppertext(H.ckey)]'\t \t \t \t[uppertext(used_name)][job]"
+ chunk += "[uppertext(background.get_random_cultural_name(H, H.gender, H.get_species()))] a.k.a. '[uppertext(H.ckey)]'\t \t \t \t[uppertext(used_name)][job]"
chunksize++
if(chunksize > 2)
cast += "
[jointext(chunk,"
")]"
@@ -119,7 +119,7 @@ var/global/list/end_titles
if(C.holder.rights & (R_DEBUG|R_ADMIN))
var/list/all_backgrounds = decls_repository.get_decls_of_subtype(/decl/background_detail/heritage)
var/decl/background_detail/cult = all_backgrounds[pick(all_backgrounds)]
- staff += "[uppertext(pick(staffjobs))] - [cult.get_random_name(C.gender)] a.k.a. '[C.key]'"
+ staff += "[uppertext(pick(staffjobs))] - [cult.get_random_cultural_name(C.mob, C.mob.gender, C.mob.get_species())] a.k.a. '[C.key]'"
else if(C.holder.rights & R_MOD)
goodboys += "[C.key]"
diff --git a/code/game/objects/__objs.dm b/code/game/objects/__objs.dm
index 62566afe1a1c..7295fe42516e 100644
--- a/code/game/objects/__objs.dm
+++ b/code/game/objects/__objs.dm
@@ -9,6 +9,9 @@
///The current health of the obj. Leave to null, unless you want the object to start at a different health than max_health.
current_health = null
+ // If non-null and positive, will create a reagent holder on Initialize()
+ var/chem_volume
+
var/obj_flags
var/datum/talking_atom/talking_atom
var/list/req_access
@@ -30,8 +33,12 @@
//Only apply directional offsets if the mappers haven't set any offsets already
if(!pixel_x && !pixel_y && !pixel_w && !pixel_z)
update_directional_offset()
- if(isnull(current_health))
+ if(isnull(current_health) || current_health == INFINITY)
current_health = get_max_health()
+ else
+ current_health = min(current_health, get_max_health())
+ if(!isnull(chem_volume) && chem_volume >= 0) // 0-volume holders perserved for legacy code reasons. Ideally shouldn't exist if <= 0
+ initialize_reagents()
/obj/object_shaken()
shake_animation()
@@ -257,13 +264,14 @@
return TRUE
/**
- * Init starting reagents and/or reagent var. Not called at the /obj level.
+ * Init starting reagents and/or reagent var. Called if chem_volume > 0 in /obj/Initialize()
* populate: If set to true, we expect map load/admin spawned reagents to be set.
*/
/obj/proc/initialize_reagents(var/populate = TRUE)
SHOULD_CALL_PARENT(TRUE)
if(reagents?.total_volume > 0)
log_warning("\The [src] possibly is initializing its reagents more than once!")
+ create_or_update_reagents(chem_volume)
if(populate)
populate_reagents()
diff --git a/code/game/objects/alien_props.dm b/code/game/objects/alien_props.dm
index 6297ef140f0b..5268d3e3a383 100644
--- a/code/game/objects/alien_props.dm
+++ b/code/game/objects/alien_props.dm
@@ -19,7 +19,7 @@
// APC
#define APC_UPDATE_ALLGOOD 128
-/obj/machinery/power/apc/alien
+/obj/machinery/apc/alien
name = "alien device"
desc = "It's affixed to the floor, with a thick wire going into it."
icon = 'icons/obj/xenoarchaeology.dmi'
@@ -30,7 +30,7 @@
/obj/item/cell/alien
)
-/obj/machinery/power/apc/alien/on_update_icon()
+/obj/machinery/apc/alien/on_update_icon()
check_updates()
if(update_state & APC_UPDATE_ALLGOOD)
icon_state = "ano11"
diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm
index ccfd9b93b6e5..1305d6ee4112 100644
--- a/code/game/objects/effects/chem/chemsmoke.dm
+++ b/code/game/objects/effects/chem/chemsmoke.dm
@@ -7,13 +7,14 @@
layer = ABOVE_PROJECTILE_LAYER
time_to_live = 300
pass_flags = PASS_FLAG_TABLE | PASS_FLAG_GRILLE | PASS_FLAG_GLASS //PASS_FLAG_GLASS is fine here, it's just so the visual effect can "flow" around glass
+ chem_volume = 500
+
var/splash_amount = 10 //atoms moving through a smoke cloud get splashed with up to 10 units of reagent
var/turf/destination
/obj/effect/effect/smoke/chem/Initialize(mapload, smoke_duration, turf/dest_turf = null, icon/cached_icon = null)
. = ..()
- create_reagents(500)
if(cached_icon)
icon = cached_icon
@@ -76,7 +77,7 @@
/////////////////////////////////////////////
/datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
- var/obj/chemholder
+ var/obj/effect/chem_holder/chemholder
var/range
var/list/targetTurfs
var/list/wallList
@@ -96,8 +97,7 @@
/datum/effect/effect/system/smoke_spread/chem/New()
..()
- chemholder = new/obj()
- chemholder.create_reagents(500)
+ chemholder = new(null, 500)
//Sets up the chem smoke effect
// Calculates the max range smoke can travel, then gets all turfs in that view range.
diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm
index 06a1a7d81f79..a961e82da284 100644
--- a/code/game/objects/effects/chem/foam.dm
+++ b/code/game/objects/effects/chem/foam.dm
@@ -11,6 +11,7 @@
layer = ABOVE_OBJ_LAYER
mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
animate_movement = 0
+ chem_volume = 10
var/amount = 3
var/metal = 0
@@ -56,11 +57,9 @@
F = new(T, metal)
F.amount = amount
- if(!metal)
- F.create_reagents(10)
- if(reagents)
- for(var/decl/material/reagent as anything in reagents.reagent_volumes)
- F.add_to_reagents(reagent, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
+ if(!metal && reagents?.total_volume)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ F.add_to_reagents(reagent, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
/obj/effect/effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) // foam disolves when heated, except metal foams
if(!metal && prob(max(0, exposed_temperature - 475)))
@@ -107,8 +106,6 @@
F.amount = amount
if(!metal) // don't carry other chemicals if a metal foam
- F.create_reagents(10)
-
if(carried_reagents)
for(var/id in carried_reagents)
F.add_to_reagents(id, 1, safety = 1) //makes a safety call because all reagents should have already reacted anyway
diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm
index 8f4dbce7bb75..aafbd41b47df 100644
--- a/code/game/objects/effects/chem/water.dm
+++ b/code/game/objects/effects/chem/water.dm
@@ -4,6 +4,7 @@
icon_state = "extinguish"
mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
pass_flags = PASS_FLAG_TABLE | PASS_FLAG_GRILLE
+ chem_volume = 10
/obj/effect/effect/water/Initialize()
. = ..()
@@ -62,3 +63,4 @@
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
icon_state = ""
+ chem_volume = 10
diff --git a/code/game/objects/effects/chem_holder.dm b/code/game/objects/effects/chem_holder.dm
new file mode 100644
index 000000000000..b6c0ea502f78
--- /dev/null
+++ b/code/game/objects/effects/chem_holder.dm
@@ -0,0 +1,6 @@
+/obj/effect/chem_holder
+ atom_flags = ATOM_FLAG_OPEN_CONTAINER
+
+/obj/effect/chem_holder/Initialize(mapload, _vol)
+ chem_volume = _vol
+ . = ..()
diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm
index 3da636a2c505..6758e59d78c8 100644
--- a/code/game/objects/effects/decals/Cleanable/misc.dm
+++ b/code/game/objects/effects/decals/Cleanable/misc.dm
@@ -81,12 +81,12 @@
icon_state = "vomit_1"
persistent = TRUE
generic_filth = TRUE
+ chem_volume = 30
/obj/effect/decal/cleanable/vomit/Initialize(ml, _age)
random_icon_states = icon_states(icon)
- . = ..()
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
- create_reagents(30, src)
+ . = ..()
if(prob(75))
set_rotation(pick(90, 180, 270))
diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index f037c65998aa..51ac6d43b52c 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -182,7 +182,7 @@
log_debug("iexpl: Beginning SFX phase.")
time = REALTIMEOFDAY
- var/volume = 10 + (power * 20)
+ var/explosion_volume = 10 + (power * 20)
var/frequency = get_rand_frequency()
var/close_dist = round(power + world.view - 2, 1)
@@ -217,12 +217,12 @@
var/dist = get_dist(M, epicenter) || 1
if ((reception & EXPLFX_SOUND) && !HAS_STATUS(M, STAT_DEAF))
if (dist <= close_dist)
- M.playsound_local(epicenter, explosion_sound, min(100, volume), 1, frequency, falloff = 5)
+ M.playsound_local(epicenter, explosion_sound, min(100, explosion_volume), 1, frequency, falloff = 5)
//You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else
- volume = M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', volume, 1, frequency, falloff = 1000)
+ explosion_volume = M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', explosion_volume, 1, frequency, falloff = 1000)
- if ((reception & EXPLFX_SHAKE) && volume > 0)
+ if ((reception & EXPLFX_SHAKE) && explosion_volume > 0)
shake_camera(M, min(30, max(2,(power*2) / dist)), min(3.5, ((power/3) / dist)),0.05)
//Maximum duration is 3 seconds, and max strength is 3.5
//Becuse values higher than those just get really silly
diff --git a/code/game/objects/items/__item.dm b/code/game/objects/items/__item.dm
index 171b27c8b98b..5c0a8f52c946 100644
--- a/code/game/objects/items/__item.dm
+++ b/code/game/objects/items/__item.dm
@@ -90,8 +90,6 @@
/// Assoc list of bodytype category to icon for producing onmob overlays when this item is held or worn.
var/list/sprite_sheets
- // Material handling for material weapons (not used by default, unless material is supplied or set)
- var/decl/material/material // Reference to material decl. If set to a string corresponding to a material ID, will init the item with that material.
///Will apply the flagged modifications to the object
var/material_alteration = MAT_FLAG_ALTERATION_NONE
var/anomaly_shielding // 0..1 value of how well it shields against xenoarch anomalies
@@ -112,7 +110,6 @@
/// Controls what method is used to resolve conflicts between equipped items and mob loadout.
var/replaced_in_loadout = LOADOUT_CONFLICT_DELETE
- var/paint_color
var/paint_verb
/// What dexterity is required to attack with this item?
diff --git a/code/game/objects/items/_item_damage.dm b/code/game/objects/items/_item_damage.dm
index 15affb6205ba..f63e42bcd930 100644
--- a/code/game/objects/items/_item_damage.dm
+++ b/code/game/objects/items/_item_damage.dm
@@ -77,14 +77,14 @@
/obj/item/throw_impact(atom/hit_atom, datum/thrownthing/TT)
. = ..()
if(isliving(hit_atom)) //Living mobs handle hit sounds differently.
- var/volume = get_volume_by_throwforce_and_or_w_class()
+ var/impact_volume = get_volume_by_throwforce_and_or_w_class()
if (get_thrown_attack_force() > 0)
if(hitsound)
- playsound(hit_atom, hitsound, volume, TRUE, -1)
+ playsound(hit_atom, hitsound, impact_volume, TRUE, -1)
else
- playsound(hit_atom, 'sound/weapons/genhit.ogg', volume, TRUE, -1)
+ playsound(hit_atom, 'sound/weapons/genhit.ogg', impact_volume, TRUE, -1)
else
- playsound(hit_atom, 'sound/weapons/throwtap.ogg', volume, TRUE, -1)
+ playsound(hit_atom, 'sound/weapons/throwtap.ogg', impact_volume, TRUE, -1)
/obj/item/proc/eyestab(mob/living/M, mob/living/user)
var/mob/living/human/H = M
diff --git a/code/game/objects/items/_item_drying.dm b/code/game/objects/items/_item_drying.dm
index c3044b33be21..5357133fe505 100644
--- a/code/game/objects/items/_item_drying.dm
+++ b/code/game/objects/items/_item_drying.dm
@@ -77,9 +77,9 @@
if(!length(matter))
return FALSE
for(var/mat in matter)
- var/decl/material/material = GET_DECL(mat)
+ var/decl/material/heated_material = GET_DECL(mat)
// We should burn if we're above the temperature damage threshold.
- if(!isnull(material.temperature_damage_threshold) && exposed_temperature >= material.temperature_damage_threshold)
+ if(!isnull(heated_material.temperature_damage_threshold) && exposed_temperature >= heated_material.temperature_damage_threshold)
return TRUE
return FALSE
diff --git a/code/game/objects/items/_item_materials.dm b/code/game/objects/items/_item_materials.dm
index 893b901af7c8..2a269fac6c9b 100644
--- a/code/game/objects/items/_item_materials.dm
+++ b/code/game/objects/items/_item_materials.dm
@@ -53,10 +53,6 @@
material.place_shards(T)
qdel(src)
-/obj/item/get_material()
- RETURN_TYPE(/decl/material)
- return material
-
// TODO: Refactor more code to use this where necessary, and then make this use
// some sort of generalized system for hitting with different parts of an item
// e.g. pommel vs blade, rifle butt vs bayonet, knife hilt vs blade
diff --git a/code/game/objects/items/_item_reagents.dm b/code/game/objects/items/_item_reagents.dm
index e664024c9520..9431fb7e70c2 100644
--- a/code/game/objects/items/_item_reagents.dm
+++ b/code/game/objects/items/_item_reagents.dm
@@ -1,5 +1,5 @@
-/obj/item/proc/standard_dispenser_refill(mob/user, obj/structure/reagent_dispensers/target, skip_container_check = FALSE) // This goes into afterattack
- if(!istype(target) || (!skip_container_check && (target.atom_flags & ATOM_FLAG_OPEN_CONTAINER)))
+/obj/item/proc/standard_dispenser_refill(mob/user, obj/structure/target, skip_container_check = FALSE) // This goes into afterattack
+ if(!istype(target) || isnull(target.get_reagent_amount_dispensed()) || (!skip_container_check && (target.atom_flags & ATOM_FLAG_OPEN_CONTAINER)))
return FALSE
if(!target.reagents || !target.reagents.total_volume)
@@ -10,7 +10,7 @@
to_chat(user, SPAN_NOTICE("[src] is full of reagents."))
return TRUE
- var/trans = target.reagents.trans_to_obj(src, target.amount_dispensed)
+ var/trans = target.reagents.trans_to_obj(src, target.get_reagent_amount_dispensed())
to_chat(user, SPAN_NOTICE("You fill [src] with [trans] units of the contents of [target]."))
return TRUE
diff --git a/code/game/objects/items/blackout.dm b/code/game/objects/items/blackout.dm
index 4bc3d51b6f41..68df55bfa2a9 100644
--- a/code/game/objects/items/blackout.dm
+++ b/code/game/objects/items/blackout.dm
@@ -74,8 +74,8 @@
var/datum/powernet/powernet = terminal_in.powernet
for(var/obj/machinery/power/terminal/terminal_out in powernet.nodes)
- if(istype(terminal_out.master, /obj/machinery/power/apc))
- var/obj/machinery/power/apc/A = terminal_out.master
+ if(istype(terminal_out.master, /obj/machinery/apc))
+ var/obj/machinery/apc/A = terminal_out.master
A.energy_fail(rand(30 * severity, 60 * severity))
if(istype(terminal_out.master, /obj/machinery/power/smes/buildable))
var/obj/machinery/power/smes/buildable/S = terminal_out.master
diff --git a/code/game/objects/items/chisel.dm b/code/game/objects/items/chisel.dm
index 8bdcf2ab1a40..fb32a9888d3b 100644
--- a/code/game/objects/items/chisel.dm
+++ b/code/game/objects/items/chisel.dm
@@ -1,4 +1,3 @@
-// Stub for forging. TODO implement TOOL_CHISEL.
/obj/item/tool/chisel
name = "chisel"
desc = "A hard, sharpened tool used to chisel stone, wood or bone."
@@ -8,5 +7,11 @@
handle_material = /decl/material/solid/organic/plastic
binding_material = null
+/obj/item/tool/chisel/get_initial_tool_qualities()
+ var/static/list/tool_qualities = list(
+ TOOL_CHISEL = TOOL_QUALITY_DEFAULT
+ )
+ return tool_qualities
+
/obj/item/tool/chisel/forged
handle_material = null
diff --git a/code/game/objects/items/circuitboards/wall.dm b/code/game/objects/items/circuitboards/wall.dm
index fe150c173d20..fe1e20a8cfcd 100644
--- a/code/game/objects/items/circuitboards/wall.dm
+++ b/code/game/objects/items/circuitboards/wall.dm
@@ -29,7 +29,7 @@
matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)
w_class = ITEM_SIZE_SMALL
obj_flags = OBJ_FLAG_CONDUCTIBLE
- build_path = /obj/machinery/power/apc/buildable
+ build_path = /obj/machinery/apc/buildable
board_type = "wall"
origin_tech = @'{"programming":1,"engineering":1}'
req_components = list()
diff --git a/code/game/objects/items/devices/boombox.dm b/code/game/objects/items/devices/boombox.dm
index 01f0e716d581..0c3e1c273082 100644
--- a/code/game/objects/items/devices/boombox.dm
+++ b/code/game/objects/items/devices/boombox.dm
@@ -14,7 +14,7 @@
)
var/playing = 0
var/track_num = 1
- var/volume = 20
+ var/music_volume = 20
var/max_volume = 40
var/frequency = 1
var/datum/sound_token/sound_token
@@ -84,10 +84,10 @@
start()
return TOPIC_HANDLED
if(href_list["volup"])
- change_volume(volume + 10)
+ change_volume(music_volume + 10)
return TOPIC_HANDLED
if(href_list["voldown"])
- change_volume(volume - 10)
+ change_volume(music_volume - 10)
return TOPIC_HANDLED
/obj/item/boombox/attackby(var/obj/item/used_item, var/mob/user)
@@ -180,7 +180,7 @@
/obj/item/boombox/proc/start()
QDEL_NULL(sound_token)
var/datum/track/T = tracks[track_num]
- sound_token = play_looping_sound(src, sound_id, T.GetTrack(), volume = volume, frequency = frequency, range = 7, falloff = 4, prefer_mute = TRUE, preference = /datum/client_preference/play_game_music, streaming = TRUE)
+ sound_token = play_looping_sound(src, sound_id, T.GetTrack(), volume = music_volume, frequency = frequency, range = 7, falloff = 4, prefer_mute = TRUE, preference = /datum/client_preference/play_game_music, streaming = TRUE)
playing = 1
update_icon()
if(prob(break_chance))
@@ -193,9 +193,9 @@
stop()
/obj/item/boombox/proc/change_volume(var/new_volume)
- volume = clamp(new_volume, 0, max_volume)
+ music_volume = clamp(new_volume, 0, max_volume)
if(sound_token)
- sound_token.SetVolume(volume)
+ sound_token.SetVolume(music_volume)
/obj/random_multi/single_item/boombox
name = "boombox spawnpoint"
diff --git a/code/game/objects/items/devices/oxycandle.dm b/code/game/objects/items/devices/oxycandle.dm
index c24ced497aef..719223e6ec8f 100644
--- a/code/game/objects/items/devices/oxycandle.dm
+++ b/code/game/objects/items/devices/oxycandle.dm
@@ -14,7 +14,7 @@
var/target_pressure = ONE_ATMOSPHERE
var/datum/gas_mixture/air_contents = null
- var/volume = 4600
+ var/candle_volume = 4600
var/on = 0
var/activation_sound = 'sound/effects/flare.ogg'
var/brightness_on = 1 // Moderate-low bright.
@@ -33,10 +33,10 @@
update_icon()
playsound(src.loc, activation_sound, 75, 1)
air_contents = new /datum/gas_mixture()
- air_contents.volume = 200 //liters
+ air_contents.total_volume = 200 //liters
air_contents.temperature = T20C
var/const/OXYGEN_FRACTION = 1 // separating out the constant so it's clearer why it exists and how to modify it later
- air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
+ air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.total_volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
START_PROCESSING(SSprocessing, src)
// Process of Oxygen candles releasing air. Makes 200 volume of oxygen
@@ -44,7 +44,7 @@
if(!loc)
return
var/turf/pos = get_turf(src)
- if(volume <= 0 || !pos || (pos.turf_flags & TURF_IS_WET)) //Now uses turf flags instead of whatever aurora did
+ if(candle_volume <= 0 || !pos || (pos.turf_flags & TURF_IS_WET)) //Now uses turf flags instead of whatever aurora did
STOP_PROCESSING(SSprocessing, src)
on = 2
update_icon()
@@ -56,16 +56,16 @@
pos.hotspot_expose(1500, 5)
var/datum/gas_mixture/environment = loc.return_air()
var/pressure_delta = target_pressure - environment.return_pressure()
- var/output_volume = environment.volume * environment.group_multiplier
+ var/output_volume = environment.total_volume * environment.group_multiplier
var/air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
if (!removed) //Just in case
return
environment.merge(removed)
- volume -= 200
+ candle_volume -= 200
var/const/OXYGEN_FRACTION = 1 // separating out the constant so it's clearer why it exists and how to modify it later
- air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
+ air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.total_volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
/obj/item/oxycandle/on_update_icon()
. = ..()
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 104617710a6e..9af027725ba4 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -139,7 +139,7 @@
// Enough power drained this tick, no need to torture more APCs
if(drained >= drain_rate)
break
- var/obj/machinery/power/apc/A = T.master_machine()
+ var/obj/machinery/apc/A = T.master_machine()
if(istype(A))
drained += A.drain_power(amount = drain_rate)
power_drained += drained
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index 40f7cc830eff..31aaf31b8044 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -175,7 +175,7 @@
/obj/item/transfer_valve/proc/merge_gases()
if(valve_open)
return
- tank_two.air_contents.volume += tank_one.air_contents.volume
+ tank_two.air_contents.total_volume += tank_one.air_contents.total_volume
var/datum/gas_mixture/temp = tank_one.remove_air_ratio(1)
tank_two.assume_air(temp)
valve_open = 1
@@ -189,9 +189,9 @@
if(QDELETED(tank_one) || QDELETED(tank_two))
return
- var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
+ var/ratio1 = tank_one.air_contents.total_volume/tank_two.air_contents.total_volume
var/datum/gas_mixture/temp = tank_two.remove_air_ratio(ratio1)
- tank_two.air_contents.volume -= tank_one.air_contents.volume
+ tank_two.air_contents.total_volume -= tank_one.air_contents.total_volume
tank_one.assume_air(temp)
/*
diff --git a/code/game/objects/items/flame/flame_fuelled.dm b/code/game/objects/items/flame/flame_fuelled.dm
index ce4c864b0a82..51cdb60beefe 100644
--- a/code/game/objects/items/flame/flame_fuelled.dm
+++ b/code/game/objects/items/flame/flame_fuelled.dm
@@ -5,8 +5,8 @@
can_manually_light = TRUE
extinguish_on_dropped = FALSE
watertight = TRUE
+ chem_volume = 5
- var/tmp/max_fuel = 5
var/tmp/start_fuelled = FALSE
/// TODO: make this calculate a fuel amount via accelerant value or some other check.
@@ -14,10 +14,9 @@
var/fuel_type
/obj/item/flame/fuelled/Initialize()
- . = ..()
if(isnull(fuel_type))
fuel_type = global.using_map.default_liquid_fuel_type
- initialize_reagents()
+ . = ..()
// Boilerplate from /obj/item/chems/glass. TODO generalize to a lower level.
/obj/item/flame/fuelled/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
@@ -84,14 +83,9 @@
return TRUE
return FALSE
-/obj/item/flame/fuelled/initialize_reagents(populate = TRUE)
- if(!reagents)
- create_reagents(max_fuel)
- . = ..()
-
/obj/item/flame/fuelled/populate_reagents()
- if(start_fuelled && fuel_type && max_fuel)
- add_to_reagents(fuel_type, max_fuel)
+ if(start_fuelled && fuel_type && reagents?.maximum_volume)
+ add_to_reagents(fuel_type, reagents.maximum_volume)
/obj/item/flame/fuelled/Process()
. = ..()
diff --git a/code/game/objects/items/flame/flame_fuelled_lantern.dm b/code/game/objects/items/flame/flame_fuelled_lantern.dm
index 38d4ca1f22f2..31504a3c324c 100644
--- a/code/game/objects/items/flame/flame_fuelled_lantern.dm
+++ b/code/game/objects/items/flame/flame_fuelled_lantern.dm
@@ -10,7 +10,7 @@
slot_flags = SLOT_LOWER_BODY
lit_light_power = 0.7
lit_light_range = 6
- max_fuel = 60
+ chem_volume = 60
_fuel_spend_amt = (1 / 60) // a full lantern should last an hour
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
material = /decl/material/solid/metal/copper
diff --git a/code/game/objects/items/flame/flame_fuelled_lighter_zippo.dm b/code/game/objects/items/flame/flame_fuelled_lighter_zippo.dm
index 50a734b487f1..399bb5063b2d 100644
--- a/code/game/objects/items/flame/flame_fuelled_lighter_zippo.dm
+++ b/code/game/objects/items/flame/flame_fuelled_lighter_zippo.dm
@@ -1,9 +1,9 @@
/obj/item/flame/fuelled/lighter/zippo
- name = "zippo lighter"
- desc = "It's a zippo-styled lighter, using a replaceable flint in a fetching steel case. It makes a clicking sound that everyone loves."
- icon = 'icons/obj/items/flame/zippo.dmi'
- max_fuel = 10
- material = /decl/material/solid/metal/stainlesssteel
+ name = "zippo lighter"
+ desc = "It's a zippo-styled lighter, using a replaceable flint in a fetching steel case. It makes a clicking sound that everyone loves."
+ icon = 'icons/obj/items/flame/zippo.dmi'
+ chem_volume = 10
+ material = /decl/material/solid/metal/stainlesssteel
/obj/item/flame/fuelled/lighter/zippo/adjust_mob_overlay(mob/living/user_mob, bodytype, image/overlay, slot, bodypart, use_fallback_if_icon_missing = TRUE, skip_offset = FALSE)
if(overlay && lit && (slot in global.all_hand_slots))
diff --git a/code/game/objects/items/rescuebag.dm b/code/game/objects/items/rescuebag.dm
index df7b9225027f..e4c56dafd6bb 100644
--- a/code/game/objects/items/rescuebag.dm
+++ b/code/game/objects/items/rescuebag.dm
@@ -70,7 +70,7 @@
/obj/structure/closet/body_bag/rescue/Initialize()
. = ..()
atmo = new()
- atmo.volume = 0.1*CELL_VOLUME
+ atmo.total_volume = 0.1*CELL_VOLUME
START_PROCESSING(SSobj, src)
/obj/structure/closet/body_bag/rescue/Destroy()
diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm
index ce927361ee62..9ec972e56958 100644
--- a/code/game/objects/items/tools/screwdriver.dm
+++ b/code/game/objects/items/tools/screwdriver.dm
@@ -20,7 +20,10 @@
if(prob(75))
pixel_y = rand(0, 16)
. = ..()
- set_extension(src, /datum/extension/tool, list(TOOL_SCREWDRIVER = TOOL_QUALITY_DEFAULT))
+ set_extension(src, /datum/extension/tool, list(
+ TOOL_SCREWDRIVER = TOOL_QUALITY_DEFAULT,
+ TOOL_CHISEL = TOOL_QUALITY_BAD
+ ))
/obj/item/screwdriver/on_update_icon()
. = ..()
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 76255a19f118..545cc0b21be6 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -47,7 +47,7 @@
throw_range = 20
possible_transfer_amounts = null
amount_per_transfer_from_this = 10
- volume = 10
+ chem_volume = 10
material = /decl/material/solid/organic/plastic
_base_attack_force = 0
diff --git a/code/game/objects/items/waterskin.dm b/code/game/objects/items/waterskin.dm
index 89baf179ab28..729f6b1e9240 100644
--- a/code/game/objects/items/waterskin.dm
+++ b/code/game/objects/items/waterskin.dm
@@ -6,7 +6,7 @@
material = /decl/material/solid/organic/leather/gut
color = /decl/material/solid/organic/leather/gut::color
atom_flags = ATOM_FLAG_OPEN_CONTAINER
- volume = 120
+ chem_volume = 120
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME
var/decl/material/stopper_material = /decl/material/solid/organic/cloth/hemp
diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm
index 353404026db9..305d0aa5f5ce 100644
--- a/code/game/objects/items/weapons/ecigs.dm
+++ b/code/game/objects/items/weapons/ecigs.dm
@@ -184,7 +184,7 @@
icon_state = "ecartridge"
material = /decl/material/solid/metal/aluminium
matter = list(/decl/material/solid/glass = MATTER_AMOUNT_REINFORCEMENT)
- volume = 20
+ chem_volume = 20
atom_flags = ATOM_FLAG_OPEN_CONTAINER
/obj/item/chems/ecig_cartridge/get_examine_strings(mob/user, distance, infix, suffix)
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 5610bf4cf254..7c57b93689e5 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -16,7 +16,7 @@
possible_transfer_amounts = @"[30,60,120]" //units of liquid per spray - 120 -> same as splashing them with a bucket per spray
possible_particle_amounts = @"[1,2,3]" //Amount of chempuff particles to spawn on spray
amount_per_transfer_from_this = 120
- volume = 2000
+ chem_volume = 2000
spray_particles = 3 //Amount of liquid particles to spawn on spray
particle_move_delay = 5 //Spray effect move delay
safety = TRUE
@@ -36,7 +36,7 @@
possible_particle_amounts = @"[1,2]"
amount_per_transfer_from_this = 80
spray_particles = 2
- volume = 1000
+ chem_volume = 1000
material = /decl/material/solid/organic/plastic
matter = list(
/decl/material/solid/metal/steel = MATTER_AMOUNT_TRACE,
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 060c4864e227..d5bb28f18f47 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -5,16 +5,14 @@
w_class = ITEM_SIZE_SMALL
_base_attack_force = 2.0
det_time = null
+ chem_volume = 1000
+
var/stage = 0
var/path = 0
var/obj/item/assembly_holder/detonator = null
var/list/beakers = new/list()
var/list/allowed_containers = list(/obj/item/chems/glass/beaker, /obj/item/chems/glass/bottle)
-/obj/item/grenade/chem_grenade/Initialize()
- . = ..()
- create_reagents(1000)
-
/obj/item/grenade/chem_grenade/Destroy()
QDEL_NULL(detonator)
QDEL_NULL_LIST(beakers)
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index 2efa8c00554f..d46890df842d 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -11,6 +11,8 @@
matter = list(
/decl/material/solid/organic/cloth = MATTER_AMOUNT_SECONDARY,
)
+ chem_volume = 30
+
var/mopspeed = 40
var/static/list/moppable_types
@@ -23,14 +25,9 @@
/obj/item/mop/Initialize()
. = ..()
- initialize_reagents()
if(!moppable_types)
populate_moppable_types()
-/obj/item/mop/initialize_reagents(populate = TRUE)
- create_reagents(30)
- . = ..()
-
/obj/item/mop/afterattack(atom/A, mob/user, proximity)
if(!proximity)
return ..()
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 49426d67046f..ddbe13a497ee 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -6,7 +6,7 @@
w_class = ITEM_SIZE_NORMAL
amount_per_transfer_from_this = 10
possible_transfer_amounts = @"[10,20,30,60]"
- volume = 60
+ chem_volume = 60
var/pigment
/obj/item/chems/glass/bucket/paint/populate_reagents()
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index ebb10a60b96d..47518ab9b3d0 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -14,8 +14,9 @@
material = /decl/material/liquid/cleaner/soap
max_health = 5
_base_attack_force = 0
- var/key_data
+ chem_volume = SOAP_MAX_VOLUME
+ var/key_data
var/list/valid_colors = list(COLOR_GREEN_GRAY, COLOR_RED_GRAY, COLOR_BLUE_GRAY, COLOR_BROWN, COLOR_PALE_PINK, COLOR_PALE_BTL_GREEN, COLOR_OFF_WHITE, COLOR_GRAY40, COLOR_GOLD)
var/list/valid_scents = list("fresh air", "cinnamon", "mint", "cocoa", "lavender", "an ocean breeze", "a summer garden", "vanilla", "cheap perfume")
var/list/scent_intensity = list("faintly", "strongly", "overbearingly")
@@ -31,16 +32,11 @@
/obj/item/soap/crafted/generate_icon()
return
-/obj/item/soap/initialize_reagents(populate = TRUE)
- create_reagents(SOAP_MAX_VOLUME)
- . = ..()
-
/obj/item/soap/populate_reagents()
wet()
/obj/item/soap/Initialize()
. = ..()
- initialize_reagents()
generate_icon()
/obj/item/soap/proc/generate_icon()
diff --git a/code/game/objects/items/weapons/storage/fancy/cigar.dm b/code/game/objects/items/weapons/storage/fancy/cigar.dm
index a83021f72999..a24b3da8a2b4 100644
--- a/code/game/objects/items/weapons/storage/fancy/cigar.dm
+++ b/code/game/objects/items/weapons/storage/fancy/cigar.dm
@@ -15,11 +15,8 @@
storage = /datum/storage/box/cigar
/obj/item/box/fancy/cigar/Initialize(ml, material_key)
- . = ..()
- initialize_reagents()
-
-/obj/item/box/fancy/cigar/initialize_reagents(populate)
- create_reagents(10 * max(1, storage?.storage_slots))
+ if(istype(storage))
+ chem_volume = 10 * max(1, storage.storage_slots)
. = ..()
/obj/item/box/fancy/cigar/WillContain()
diff --git a/code/game/objects/items/weapons/storage/fancy/cigarettes.dm b/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
index 379d275b5f8f..80610b50e2cc 100644
--- a/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
+++ b/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
@@ -17,11 +17,7 @@
return list(/obj/item/clothing/mask/smokable/cigarette = 6)
/obj/item/box/fancy/cigarettes/Initialize(ml, material_key)
- . = ..()
- initialize_reagents()
-
-/obj/item/box/fancy/cigarettes/initialize_reagents(populate)
- create_reagents(5 * max(storage?.max_storage_space, 1)) //so people can inject cigarettes without opening a packet, now with being able to inject the whole one
+ chem_volume = 5 * max(/datum/storage/box/cigarettes::max_storage_space, 1) //so people can inject cigarettes without opening a packet, now with being able to inject the whole one
. = ..()
/obj/item/box/fancy/cigarettes/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
diff --git a/code/game/objects/items/weapons/storage/laundry_basket.dm b/code/game/objects/items/weapons/storage/laundry_basket.dm
index 4d03a5567929..deb912d9ba69 100644
--- a/code/game/objects/items/weapons/storage/laundry_basket.dm
+++ b/code/game/objects/items/weapons/storage/laundry_basket.dm
@@ -1,72 +1,40 @@
-// -----------------------------
-// Laundry Basket
-// -----------------------------
-// An item designed for hauling the belongings of a character.
-// So this cannot be abused for other uses, we make it two-handed and inable to have its storage looked into.
/obj/item/laundry_basket
name = "laundry basket"
- icon = 'icons/obj/janitor.dmi'
- icon_state = "laundry-empty"
- item_state = "laundry"
+ icon = 'icons/obj/items/storage/laundry.dmi'
+ icon_state = ICON_STATE_WORLD
desc = "The peak of thousands of years of laundry evolution."
w_class = ITEM_SIZE_GARGANTUAN
storage = /datum/storage/laundry_basket
material = /decl/material/solid/organic/plastic
obj_flags = OBJ_FLAG_HOLLOW
- var/linked
-
-/obj/item/laundry_basket/attack_hand(mob/user)
- if(!ishuman(user))
- return ..()
- var/mob/living/human/H = user
- var/obj/item/organ/external/temp = GET_EXTERNAL_ORGAN(H, H.get_active_held_item_slot())
- if(!temp)
- to_chat(user, SPAN_WARNING("You need two hands to pick this up!"))
- return TRUE
- if(!user.get_empty_hand_slot())
- to_chat(user, SPAN_WARNING("You need a hand to be empty."))
- return TRUE
- return ..()
+ paint_color = COLOR_NAVY_BLUE
/obj/item/laundry_basket/attack_self(mob/user)
- var/turf/T = get_turf(user)
- to_chat(user, "You dump \the [src]'s contents onto \the [T].")
+ var/turf/dump_loc = get_turf(user)
+ if(length(contents) && dump_loc)
+ to_chat(user, SPAN_NOTICE("You dump \the [src]'s contents onto \the [dump_loc]."))
+ for(var/atom/movable/thing as anything in get_contained_external_atoms())
+ thing.dropInto(dump_loc)
+ return TRUE
return ..()
-/obj/item/laundry_basket/on_picked_up(mob/user, atom/old_loc)
- var/obj/item/laundry_basket/offhand/O = new(user)
- O.SetName("[name] - second hand")
- O.desc = "Your second grip on \the [src]."
- O.linked = src
- user.put_in_inactive_hand(O)
- linked = O
- return
-
-/obj/item/laundry_basket/on_update_icon()
+/obj/item/laundry_basket/Entered(atom/movable/atom, atom/old_loc)
. = ..()
- if(contents.len)
- icon_state = "laundry-full"
- else
- icon_state = "laundry-empty"
+ update_clothing_icon()
-/obj/item/laundry_basket/handle_mouse_drop(atom/over, mob/user, params)
- if(over == user)
- return TRUE
+/obj/item/laundry_basket/Exited(atom/movable/atom, atom/old_loc)
. = ..()
+ update_clothing_icon()
-/obj/item/laundry_basket/dropped(mob/user)
- qdel(linked)
- return ..()
-
-//Offhand
-/obj/item/laundry_basket/offhand
- icon = 'icons/mob/offhand.dmi'
- icon_state = "offhand"
- name = "second hand"
- storage = null
-
-/obj/item/laundry_basket/offhand/dropped(mob/user)
- ..()
- user.drop_from_inventory(linked)
- return
-
+/obj/item/laundry_basket/on_update_icon()
+ . = ..()
+ icon_state = get_world_inventory_state()
+ cut_overlays()
+ if(length(contents))
+ add_overlay(overlay_image(icon, "[icon_state]-full", COLOR_WHITE, RESET_COLOR))
+
+/obj/item/laundry_basket/get_mob_overlay(mob/user_mob, slot, bodypart, use_fallback_if_icon_missing, skip_adjustment)
+ var/image/res = ..()
+ if(length(contents))
+ res.overlays += overlay_image(res.icon, "[res.icon_state]-full", COLOR_WHITE, RESET_COLOR)
+ return res
diff --git a/code/game/objects/items/weapons/storage/med_pouch.dm b/code/game/objects/items/weapons/storage/med_pouch.dm
index 5151fadcfdd9..a24f2ff187cb 100644
--- a/code/game/objects/items/weapons/storage/med_pouch.dm
+++ b/code/game/objects/items/weapons/storage/med_pouch.dm
@@ -189,22 +189,22 @@ Single Use Emergency Pouches
// Pills
/obj/item/chems/pill/pouch_pill
- name = "emergency pill"
- desc = "An emergency pill from an emergency medical pouch."
- icon_state = "pill2"
- volume = 15
+ name = "emergency pill"
+ desc = "An emergency pill from an emergency medical pouch."
+ icon_state = "pill2"
+ chem_volume = 15
abstract_type = /obj/item/chems/pill/pouch_pill
+ var/_reagent_name
/obj/item/chems/pill/pouch_pill/Initialize(ml, material_key)
. = ..()
if(!reagents?.total_volume)
log_warning("[log_info_line(src)] was deleted for containing no reagents during init!")
return INITIALIZE_HINT_QDEL
-
-/obj/item/chems/pill/pouch_pill/initialize_reagents(populate = TRUE)
- . = ..()
- if(populate && reagents?.get_primary_reagent_name())
- SetName("emergency [reagents.get_primary_reagent_name()] pill ([reagents.total_volume]u)")
+ if(reagents?.get_primary_reagent_name() && !_reagent_name)
+ _reagent_name = "emergency [reagents.get_primary_reagent_name()] pill ([reagents.total_volume]u)"
+ if(_reagent_name)
+ SetName(_reagent_name)
/obj/item/chems/pill/pouch_pill/stabilizer/populate_reagents()
add_to_reagents(/decl/material/liquid/stabilizer, reagents.maximum_volume)
diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm
index 643125e14e14..13c9162b87f9 100644
--- a/code/game/objects/items/weapons/tanks/tank_types.dm
+++ b/code/game/objects/items/weapons/tanks/tank_types.dm
@@ -16,7 +16,7 @@
icon = 'icons/obj/items/tanks/tank_blue.dmi'
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
starting_pressure = list(/decl/material/gas/oxygen = 6 ATM)
- volume = 180
+ gas_volume = 180
/obj/item/tank/oxygen/yellow
desc = "A tank of oxygen. This one is yellow."
@@ -37,7 +37,7 @@
desc = "Mixed anyone?"
icon = 'icons/obj/items/tanks/tank_blue.dmi'
starting_pressure = list(/decl/material/gas/oxygen = (6 ATM) * O2STANDARD, /decl/material/gas/nitrogen = (6 ATM) * N2STANDARD)
- volume = 180
+ gas_volume = 180
/*
* Hydrogen
@@ -69,7 +69,7 @@
attack_cooldown = DEFAULT_WEAPON_COOLDOWN
melee_accuracy_bonus = -10
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
- volume = 40 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
+ gas_volume = 40 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
/obj/item/tank/emergency/oxygen
name = "emergency oxygen tank"
@@ -81,13 +81,13 @@
/obj/item/tank/emergency/oxygen/engi
name = "extended-capacity emergency oxygen tank"
icon = 'icons/obj/items/tanks/tank_emergency_engineer.dmi'
- volume = 60
+ gas_volume = 60
/obj/item/tank/emergency/oxygen/double
name = "double emergency oxygen tank"
icon = 'icons/obj/items/tanks/tank_emergency_double.dmi'
gauge_icon = "indicator_emergency_double"
- volume = 90
+ gas_volume = 90
w_class = ITEM_SIZE_NORMAL
/obj/item/tank/emergency/oxygen/double/red //firefighting tank, fits on belt, back or suitslot
@@ -105,4 +105,4 @@
icon = 'icons/obj/items/tanks/tank_red.dmi'
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
starting_pressure = list(/decl/material/gas/nitrogen = 10 ATM)
- volume = 180
\ No newline at end of file
+ gas_volume = 180
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 55bedc9bca88..9af831affc7d 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -42,7 +42,7 @@ var/global/list/global/tank_gauge_cache = list()
var/maxintegrity = 20
var/valve_welded = 0
var/obj/item/tankassemblyproxy/proxyassembly
- var/volume = 70
+ var/gas_volume = 70
//Used by _onclick/hud/screen_objects.dm internals to determine if someone has messed with our tank or not.
//If they have and we haven't scanned it with the PDA or gas analyzer then we might just breath whatever they put in it.
var/manipulated_by = null
@@ -56,9 +56,9 @@ var/global/list/global/tank_gauge_cache = list()
proxyassembly = new /obj/item/tankassemblyproxy(src)
proxyassembly.tank = src
- air_contents = new /datum/gas_mixture(volume, T20C)
+ air_contents = new /datum/gas_mixture(gas_volume, T20C)
for(var/gas in starting_pressure)
- air_contents.adjust_gas(gas, starting_pressure[gas]*volume/(R_IDEAL_GAS_EQUATION*T20C), 0)
+ air_contents.adjust_gas(gas, starting_pressure[gas]*gas_volume/(R_IDEAL_GAS_EQUATION*T20C), 0)
air_contents.update_values()
START_PROCESSING(SSobj, src)
@@ -366,7 +366,7 @@ var/global/list/global/tank_gauge_cache = list()
var/datum/gas_mixture/removed = remove_air(distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature))
if(removed)
- removed.volume = volume_to_return
+ removed.total_volume = volume_to_return
return removed
/obj/item/tank/Process()
@@ -418,7 +418,7 @@ var/global/list/global/tank_gauge_cache = list()
pressure = air_contents.return_pressure()
var/strength = ((pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE)
- var/mult = ((air_contents.volume/140)**(1/2)) * (air_contents.total_moles**2/3)/((29*0.64) **2/3) //tanks appear to be experiencing a reduction on scale of about 0.64 total moles
+ var/mult = ((air_contents.total_volume/140)**(1/2)) * (air_contents.total_moles**2/3)/((29*0.64) **2/3) //tanks appear to be experiencing a reduction on scale of about 0.64 total moles
//tanks appear to be experiencing a reduction on scale of about 0.64 total moles
var/turf/T = get_turf(src)
@@ -514,7 +514,7 @@ var/global/list/global/tank_gauge_cache = list()
desc = initial(tank_copy.desc)
icon = initial(tank_copy.icon)
icon_state = initial(tank_copy.icon_state)
- volume = initial(tank_copy.volume)
+ gas_volume = initial(tank_copy.gas_volume)
// Set up explosive mix.
air_contents.gas[DEFAULT_GAS_ACCELERANT] = 4 + rand(4)
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index d10c34c4f8e3..0e443936683c 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -11,7 +11,6 @@
max_amount = 32
w_class = ITEM_SIZE_SMALL
material = /decl/material/solid/organic/plastic
- current_health = 10
max_health = 10
matter_multiplier = 0.25
diff --git a/code/game/objects/items/weapons/towels.dm b/code/game/objects/items/weapons/towels.dm
index 80cacb07e3da..623042a6c029 100644
--- a/code/game/objects/items/weapons/towels.dm
+++ b/code/game/objects/items/weapons/towels.dm
@@ -17,8 +17,8 @@
var/additional_description
/obj/item/towel/Initialize()
+ chem_volume = round(50 * (w_class / ITEM_SIZE_NORMAL)) // larger towels have more room, smaller ones have less
. = ..()
- initialize_reagents()
/obj/item/towel/Destroy()
if(is_processing)
@@ -66,10 +66,6 @@
if(!reagents?.total_volume)
return PROCESS_KILL
-/obj/item/towel/initialize_reagents()
- create_reagents(round(50 * (w_class / ITEM_SIZE_NORMAL))) // larger towels have more room, smaller ones have less
- . = ..()
-
/obj/item/towel/update_name()
if(reagents?.total_volume)
if(!REAGENTS_FREE_SPACE(reagents))
diff --git a/code/game/objects/items/welding/weldbackpack.dm b/code/game/objects/items/welding/weldbackpack.dm
index 661197c56601..82db07b9617a 100644
--- a/code/game/objects/items/welding/weldbackpack.dm
+++ b/code/game/objects/items/welding/weldbackpack.dm
@@ -62,14 +62,14 @@
//Welder Pack
////////////////////////////////////////////////////////////
/obj/item/chems/weldpack
- name = "welding kit"
- desc = "An unwieldy, heavy backpack with two massive fuel tanks. Comes with an attached welder gun."
- icon = 'icons/obj/items/welderpack.dmi'
- icon_state = ICON_STATE_WORLD
- slot_flags = SLOT_BACK
- w_class = ITEM_SIZE_HUGE
- atom_flags = ATOM_FLAG_OPEN_CONTAINER
- volume = 350
+ name = "welding kit"
+ desc = "An unwieldy, heavy backpack with two massive fuel tanks. Comes with an attached welder gun."
+ icon = 'icons/obj/items/welderpack.dmi'
+ icon_state = ICON_STATE_WORLD
+ slot_flags = SLOT_BACK
+ w_class = ITEM_SIZE_HUGE
+ atom_flags = ATOM_FLAG_OPEN_CONTAINER
+ chem_volume = 350
var/obj/item/weldingtool/weldpack/welder = /obj/item/weldingtool/weldpack
// Duplicated from welder tanks.
diff --git a/code/game/objects/items/welding/weldingtool_tank.dm b/code/game/objects/items/welding/weldingtool_tank.dm
index b28b73115dff..ed87e2be8489 100644
--- a/code/game/objects/items/welding/weldingtool_tank.dm
+++ b/code/game/objects/items/welding/weldingtool_tank.dm
@@ -10,9 +10,8 @@
w_class = ITEM_SIZE_SMALL
atom_flags = ATOM_FLAG_OPEN_CONTAINER
obj_flags = OBJ_FLAG_HOLLOW
- volume = 20
+ chem_volume = 20
presentation_flags = PRESENTATION_FLAG_NAME
- current_health = 40
max_health = 40
material = /decl/material/solid/metal/steel
var/can_refuel = TRUE
@@ -87,7 +86,7 @@
base_name = "small welding tank"
icon_state = "tank_small"
w_class = ITEM_SIZE_TINY
- volume = 5
+ chem_volume = 5
size_in_use = ITEM_SIZE_SMALL
unlit_force = 5
lit_force = 7
@@ -98,7 +97,7 @@
base_name = "large welding tank"
icon_state = "tank_large"
w_class = ITEM_SIZE_SMALL
- volume = 40
+ chem_volume = 40
size_in_use = ITEM_SIZE_NORMAL
_base_attack_force = 6
@@ -107,7 +106,7 @@
base_name = "huge welding tank"
icon_state = "tank_huge"
w_class = ITEM_SIZE_NORMAL
- volume = 80
+ chem_volume = 80
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
lit_force = 15
@@ -118,7 +117,7 @@
base_name = "experimental welding tank"
icon_state = "tank_experimental"
w_class = ITEM_SIZE_NORMAL
- volume = 40
+ chem_volume = 40
can_refuel = FALSE
size_in_use = ITEM_SIZE_LARGE
unlit_force = 9
diff --git a/code/game/objects/structures/__structure.dm b/code/game/objects/structures/__structure.dm
index 2a90385995b3..704ab61cde54 100644
--- a/code/game/objects/structures/__structure.dm
+++ b/code/game/objects/structures/__structure.dm
@@ -17,7 +17,6 @@
var/footstep_type
var/mob_offset
- var/paint_color
var/paint_verb
/obj/structure/get_color()
@@ -70,18 +69,32 @@
lock = new /datum/lock(src, lock)
if(!CanFluidPass())
fluid_update(TRUE)
+ if (!isnull(get_possible_reagent_transfer_amounts()))
+ verbs |= /obj/structure/proc/set_reagent_amount_dispensed_verb
/obj/structure/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
- if(distance <= 3)
- if(distance <= 1 && lock)
- . += SPAN_NOTICE("\The [src] appears to have a lock, opened by '[lock.lock_data]'.")
- var/damage_desc = get_examined_damage_string()
- if(length(damage_desc))
- . += damage_desc
- if(paint_color)
- var/decl/pronouns/structure_pronouns = get_pronouns() // so we can do 'have' for plural objects like sheets
- . += "\The [src] [structure_pronouns.has] been [paint_verb]."
+ if(distance > 3)
+ return
+ if(distance <= 1 && lock)
+ . += SPAN_NOTICE("\The [src] appears to have a lock, opened by '[lock.lock_data]'.")
+ var/damage_desc = get_examined_damage_string()
+ if(length(damage_desc))
+ . += damage_desc
+ if(paint_color)
+ var/decl/pronouns/structure_pronouns = get_pronouns() // so we can do 'have' for plural objects like sheets
+ . += "\The [src] [structure_pronouns.has] been [paint_verb]."
+ if(distance <= 2 && !isnull(get_possible_reagent_transfer_amounts()) && reagents)
+ . += SPAN_NOTICE("It contains:")
+ if(LAZYLEN(reagents.reagent_volumes))
+ for(var/decl/material/reagent as anything in reagents.liquid_volumes)
+ . += SPAN_NOTICE("[LIQUID_VOLUME(reagents, reagent)] unit\s of [reagent.get_reagent_name(reagents, MAT_PHASE_LIQUID)].")
+ for(var/decl/material/reagent as anything in reagents.solid_volumes)
+ . += SPAN_NOTICE("[SOLID_VOLUME(reagents, reagent)] unit\s of [reagent.get_reagent_name(reagents, MAT_PHASE_SOLID)].")
+ else
+ . += SPAN_NOTICE("Nothing.")
+ if(reagents.maximum_volume)
+ . += "It may contain up to [reagents.maximum_volume] unit\s."
/obj/structure/get_examine_hints(mob/user, distance, infix, suffix)
. = ..()
@@ -125,7 +138,7 @@
return FALSE
/obj/structure/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
- if(current_health == -1) // This object does not take damage.
+ if(current_health == ITEM_HEALTH_NO_DAMAGE) // This object does not take damage.
return
if(material && material.is_brittle())
@@ -346,3 +359,8 @@ Note: This proc can be overwritten to allow for different types of auto-alignmen
visible_message(SPAN_DANGER("\The [src] was hit by \the [AM]."))
playsound(src.loc, hitsound, 100, 1)
take_damage(AM.get_thrown_attack_force() * (TT.speed/THROWFORCE_SPEED_DIVISOR), AM.atom_damage_type)
+
+/obj/structure/get_alt_interactions(var/mob/user)
+ . = ..()
+ if(!isnull(get_possible_reagent_transfer_amounts()))
+ LAZYADD(., /decl/interaction_handler/set_transfer/structure)
diff --git a/code/game/objects/structures/_structure_construction.dm b/code/game/objects/structures/_structure_construction.dm
index 85ffb92fa599..37d86d02566a 100644
--- a/code/game/objects/structures/_structure_construction.dm
+++ b/code/game/objects/structures/_structure_construction.dm
@@ -61,6 +61,14 @@
/obj/structure/attackby(obj/item/used_item, mob/user)
+ // We do this here to avoid putting the vessel straight into storage.
+ // This is usually handled by afterattack on /chems.
+ if(storage && !isnull(get_possible_reagent_transfer_amounts()) && ATOM_IS_OPEN_CONTAINER(used_item) && user.check_intent(I_FLAG_HELP))
+ if(used_item.standard_dispenser_refill(user, src))
+ return TRUE
+ if(used_item.standard_pour_into(user, src))
+ return TRUE
+
if(used_item.user_can_attack_with(user, silent = TRUE))
var/force = used_item.expend_attack_force(user)
if(force && user.check_intent(I_FLAG_HARM))
diff --git a/code/game/objects/structures/_structure_materials.dm b/code/game/objects/structures/_structure_materials.dm
index 533df4ca3d72..ccb8ddf43076 100644
--- a/code/game/objects/structures/_structure_materials.dm
+++ b/code/game/objects/structures/_structure_materials.dm
@@ -1,16 +1,10 @@
/obj/structure
- var/decl/material/material
- var/decl/material/reinf_material
var/material_alteration
var/dismantled
var/name_prefix
/// The base alpha used to calculate material-based alpha in update_material_color().
var/base_alpha = 50
-/obj/structure/get_material()
- RETURN_TYPE(/decl/material)
- return material
-
/obj/structure/proc/get_material_health_modifier()
. = 1
diff --git a/code/game/objects/structures/barrels/barrel.dm b/code/game/objects/structures/barrels/barrel.dm
index 73424c453224..c14f9007882d 100644
--- a/code/game/objects/structures/barrels/barrel.dm
+++ b/code/game/objects/structures/barrels/barrel.dm
@@ -12,15 +12,18 @@
wrenchable = FALSE
storage = /datum/storage/barrel
amount_dispensed = 10
- volume = 7500
+ chem_volume = 7500
movable_flags = MOVABLE_FLAG_WHEELED
throwpass = TRUE
tool_interaction_flags = TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT
// Should we draw our lid and liquid contents as overlays?
var/show_liquid_contents = TRUE
- // Rivets, bands, etc. Currently just cosmetic.
+ // Rivets, bands, etc. Currently just cosmetic unless the forging modpack is ticked.
var/decl/material/metal_material = /decl/material/solid/metal/iron
+// Stub type for crafting (forging modpack modifies metal_material)
+/obj/structure/reagent_dispensers/barrel/crafted
+
// Overrides due to wonky reagent_dispeners opencontainer flag handling.
/obj/structure/reagent_dispensers/barrel/can_be_poured_from(mob/user, atom/target)
return (reagents?.maximum_volume > 0)
diff --git a/code/game/objects/structures/barrels/cask.dm b/code/game/objects/structures/barrels/cask.dm
index d3755dfe55e6..603cf2d64335 100644
--- a/code/game/objects/structures/barrels/cask.dm
+++ b/code/game/objects/structures/barrels/cask.dm
@@ -6,6 +6,9 @@
show_liquid_contents = FALSE
storage = null // Intended for storing liquids.
+// Stub type for crafting (forging modpack modifies metal_material)
+/obj/structure/reagent_dispensers/barrel/cask/crafted
+
// Horrible workaround for physical interaction checks.
/obj/structure/reagent_dispensers/barrel/cask/nano_host()
return istype(loc, /obj/structure/cask_rack) ? loc : src
diff --git a/code/game/objects/structures/beds/rollerbed.dm b/code/game/objects/structures/beds/rollerbed.dm
index a3f332b4b044..39ad505e97d4 100644
--- a/code/game/objects/structures/beds/rollerbed.dm
+++ b/code/game/objects/structures/beds/rollerbed.dm
@@ -22,9 +22,9 @@
icon_state = "up"
else
icon_state = "down"
- if(beaker)
+ if(beaker?.reagents)
var/image/iv = image(icon, "iv[iv_attached]")
- var/percentage = round((beaker.reagents.total_volume / beaker.volume) * 100, 25)
+ var/percentage = round((beaker.reagents.total_volume / max(beaker.reagents.maximum_volume, 1)) * 100, 25)
var/image/filling = image(icon, "iv_filling[percentage]")
filling.color = beaker.reagents.get_color()
iv.overlays += filling
@@ -74,7 +74,7 @@
if(SSobj.times_fired % 2)
return
- if(beaker.volume > 0)
+ if(beaker.reagents?.total_volume > 0)
beaker.reagents.trans_to_mob(buckled_mob, beaker.amount_per_transfer_from_this, CHEM_INJECT)
queue_icon_update()
diff --git a/code/game/objects/structures/chemistry/filter_stand.dm b/code/game/objects/structures/chemistry/filter_stand.dm
index 3cd598d2e7be..b236e3f3dd29 100644
--- a/code/game/objects/structures/chemistry/filter_stand.dm
+++ b/code/game/objects/structures/chemistry/filter_stand.dm
@@ -8,18 +8,11 @@
material = /decl/material/solid/organic/wood/oak
material_alteration = MAT_FLAG_ALTERATION_ALL
atom_flags = ATOM_FLAG_OPEN_CONTAINER
+ chem_volume = 200
var/obj/item/chems/filter/filter
var/obj/item/chems/glass/loaded
-/obj/structure/filter_stand/Initialize(ml, _mat, _reinf_mat)
- . = ..()
- initialize_reagents()
-
-/obj/structure/filter_stand/initialize_reagents(populate)
- create_reagents(200)
- . = ..()
-
/obj/structure/filter_stand/mapped/Initialize(ml, _mat, _reinf_mat)
filter = new(src)
set_loaded_vessel(new /obj/item/chems/glass/handmade/jar(src))
@@ -111,7 +104,7 @@
w_class = ITEM_SIZE_TINY
material_alteration = MAT_FLAG_ALTERATION_ALL
material = /decl/material/solid/organic/cloth
- volume = 100
+ chem_volume = 100
atom_flags = ATOM_FLAG_OPEN_CONTAINER
/obj/item/chems/filter/on_reagent_change()
diff --git a/code/game/objects/structures/compost.dm b/code/game/objects/structures/compost.dm
index e8f3c18ec831..5d9c3dd623ed 100644
--- a/code/game/objects/structures/compost.dm
+++ b/code/game/objects/structures/compost.dm
@@ -16,7 +16,7 @@ var/global/const/COMPOST_WORM_HUNGER_FACTOR = MINIMUM_CHEMICAL_VOLUME
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
wrenchable = FALSE
possible_transfer_amounts = @"[10,25,50,100]"
- volume = 2000
+ chem_volume = 2000
storage = /datum/storage/hopper/industrial/compost
/obj/structure/reagent_dispensers/compost_bin/Initialize()
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
index ff568d29a611..1c2713ef45a2 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
@@ -1,13 +1,11 @@
/obj/structure/closet/secure_closet
name = "secure locker"
desc = "It's a card-locked storage unit."
-
closet_appearance = /decl/closet_appearance/secure_closet
setup = CLOSET_HAS_LOCK | CLOSET_CAN_BE_WELDED
locked = TRUE
-
wall_mounted = 0 //never solid (You can always pass over it)
- current_health = 200
+ max_health = 200
/obj/structure/closet/secure_closet/slice_into_parts(obj/item/weldingtool/welder, mob/user)
to_chat(user, "\The [src] is too strong to be taken apart.")
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 946821ceff5a..a8bac2f5fa78 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -6,7 +6,7 @@
density = TRUE
anchored = TRUE
setup = 0
- current_health = 0 //destroying the statue kills the mob within
+ max_health = 1 //destroying the statue kills the mob within
var/intialTox = 0 //these are here to keep the mob from taking damage from things that logically wouldn't affect a rock
var/intialFire = 0 //it's a little sloppy I know but it was this or the GODMODE flag. Lesser of two evils.
var/intialBrute = 0
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 4eaac0b2cc2e..6b85c90efb6d 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -327,14 +327,14 @@
var/decl/material/overlay_material = /decl/material/solid/metal/iron
/obj/structure/closet/crate/chest/Initialize()
- . = ..()
if(ispath(overlay_material))
overlay_material = GET_DECL(overlay_material)
+ . = ..()
// icon update is already queued in parent because of closet appearance
/obj/structure/closet/crate/chest/update_material_desc(override_desc)
..()
- if(overlay_material)
+ if(istype(overlay_material))
desc = "[desc] It has a trim made of [overlay_material.solid_name]."
/obj/structure/closet/crate/chest/on_update_icon()
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index cf7af2c01748..04cd6b7e88f7 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -5,22 +5,43 @@
anchored = FALSE
density = TRUE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
+
+ material = /decl/material/solid/metal/steel
+ material_alteration = MAT_FLAG_ALTERATION_NAME
+
+ var/can_install_glass = TRUE
var/state = 0
- var/base_name = "Airlock"
+ var/base_name = "airlock assembly"
var/obj/item/stock_parts/circuitboard/airlock_electronics/electronics = null
var/airlock_type = /obj/machinery/door/airlock //the type path of the airlock once completed
- var/glass = 0 // 0 = glass can be installed. -1 = glass can't be installed. 1 = glass is already installed.
- var/glass_material = /decl/material/solid/glass // if this door was to built right now and be made of glass, what material should the glass be?
var/created_name = null
var/panel_icon = 'icons/obj/doors/station/panel.dmi'
var/fill_icon = 'icons/obj/doors/station/fill_steel.dmi'
var/glass_icon = 'icons/obj/doors/station/fill_glass.dmi'
var/paintable = PAINT_PAINTABLE|PAINT_STRIPABLE
- var/door_color = "none"
- var/stripe_color = "none"
- var/symbol_color = "none"
+ var/door_color
+ var/stripe_color
+ var/symbol_color
var/width = 1 // For multi-tile doors
+/obj/structure/door_assembly/update_material_name(override_name)
+ var/modifier
+ switch (state)
+ if(0)
+ if(anchored)
+ modifier = "secured "
+ if(1)
+ modifier = "wired "
+ if(2)
+ modifier = "near-finished "
+ if(reinf_material)
+ SetName("[modifier][reinf_material.solid_name] window [base_name]")
+ else
+ SetName("[modifier][base_name]")
+
+/obj/structure/door_assembly/window
+ reinf_material = /decl/material/solid/glass
+
/obj/structure/door_assembly/Initialize(mapload, _mat, _reinf_mat, _dir)
. = ..(mapload, _mat, _reinf_mat)
set_dir(_dir)
@@ -52,10 +73,9 @@
if(0)
LAZYADD(., "Use a wrench to [anchored ? "un" : ""]anchor it.")
if(!anchored)
- if(glass == 1)
- var/decl/material/glass_material_datum = GET_DECL(glass_material)
- if(glass_material_datum)
- var/mat_name = glass_material_datum.solid_name || glass_material_datum.name
+ if(can_install_glass)
+ if(reinf_material)
+ var/mat_name = reinf_material.solid_name || reinf_material.name
LAZYADD(., "Use a welder to remove the [mat_name] plating currently attached.")
else
LAZYADD(., "Use a welder to disassemble completely.")
@@ -72,23 +92,23 @@
icon = 'icons/obj/doors/hatch/door.dmi'
panel_icon = 'icons/obj/doors/hatch/panel.dmi'
fill_icon = 'icons/obj/doors/hatch/fill_steel.dmi'
- base_name = "Airtight Hatch"
+ base_name = "airtight hatch"
airlock_type = /obj/machinery/door/airlock/hatch
- glass = -1
+ can_install_glass = FALSE
/obj/structure/door_assembly/door_assembly_highsecurity // Borrowing this until WJohnston makes sprites for the assembly
icon = 'icons/obj/doors/secure/door.dmi'
fill_icon = 'icons/obj/doors/secure/fill_steel.dmi'
- base_name = "High Security Airlock"
+ base_name = "high security airlock"
airlock_type = /obj/machinery/door/airlock/highsecurity
- glass = -1
+ can_install_glass = FALSE
paintable = 0
/obj/structure/door_assembly/door_assembly_ext
icon = 'icons/obj/doors/external/door.dmi'
fill_icon = 'icons/obj/doors/external/fill_steel.dmi'
glass_icon = 'icons/obj/doors/external/fill_glass.dmi'
- base_name = "External Airlock"
+ base_name = "external airlock"
airlock_type = /obj/machinery/door/airlock/external
paintable = 0
@@ -105,7 +125,7 @@
icon = 'icons/obj/doors/rapid_pdoor.dmi'
icon_state = "pdoor1"
airlock_type = /obj/machinery/door/blast/regular
- glass = -1
+ can_install_glass = FALSE
paintable = 0
/obj/structure/door_assembly/blast/on_update_icon()
@@ -135,23 +155,21 @@
created_name = t
return TRUE
- if(IS_WELDER(used_item) && (glass == 1 || !anchored))
+ if(IS_WELDER(used_item) && (can_install_glass || !anchored))
var/obj/item/weldingtool/welder = used_item
if (welder.weld(0, user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
- if(glass == 1)
- var/decl/material/glass_material_datum = GET_DECL(glass_material)
- if(glass_material_datum)
- var/mat_name = glass_material_datum.solid_name || glass_material_datum.name
- user.visible_message("[user] welds the [mat_name] plating off the airlock assembly.", "You start to weld the [mat_name] plating off the airlock assembly.")
- if(do_after(user, 4 SECONDS, src))
- if(!welder.isOn())
- return TRUE
- to_chat(user, "You welded the [mat_name] plating off!")
- glass_material_datum.create_object(get_turf(src), 2)
- glass = 0
- update_icon()
- return TRUE
+ if(reinf_material)
+ var/mat_name = reinf_material.solid_name
+ user.visible_message("[user] welds the [mat_name] plating off the airlock assembly.", "You start to weld the [mat_name] plating off the airlock assembly.")
+ if(do_after(user, 4 SECONDS, src))
+ if(!welder.isOn())
+ return TRUE
+ to_chat(user, "You welded the [mat_name] plating off!")
+ reinf_material.create_object(get_turf(src), 2)
+ reinf_material = null
+ update_icon()
+ return TRUE
if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 4 SECONDS, src))
@@ -243,17 +261,16 @@
update_icon()
return TRUE
- else if(istype(used_item, /obj/item/stack/material) && !glass)
+ else if(istype(used_item, /obj/item/stack/material) && can_install_glass && !reinf_material)
var/obj/item/stack/material/S = used_item
- var/material_name = S.get_material_type()
+ var/decl/material/sheet_material = S.get_material()
if (S.get_amount() >= 2)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
- if(do_after(user, 4 SECONDS, src) && !glass)
+ if(do_after(user, 4 SECONDS, src) && can_install_glass && !reinf_material)
if (S.use(2))
- to_chat(user, "You installed reinforced glass windows into the airlock assembly.")
- glass = 1
- glass_material = material_name
+ reinf_material = sheet_material
+ to_chat(user, "You installed [reinf_material.solid_name] windows into the airlock assembly.")
update_icon()
return TRUE
return FALSE
@@ -274,24 +291,22 @@
/obj/structure/door_assembly/on_update_icon()
..()
+
var/image/filling_overlay
- var/image/panel_overlay
- var/final_name = ""
- if(glass == 1)
+ if(reinf_material)
filling_overlay = image(glass_icon, "construction")
+ filling_overlay.color = reinf_material.color
+ filling_overlay.appearance_flags |= RESET_COLOR
else
filling_overlay = image(fill_icon, "construction")
- switch (state)
- if(0)
- if (anchored)
- final_name = "Secured "
+ if(filling_overlay)
+ add_overlay(filling_overlay)
+
+ var/image/panel_overlay
+ switch(state)
if(1)
- final_name = "Wired "
panel_overlay = image(panel_icon, "construction0")
if(2)
- final_name = "Near Finished "
panel_overlay = image(panel_icon, "construction1")
- final_name += "[glass == 1 ? "Window " : ""][istext(glass) ? "[glass] Airlock" : base_name] Assembly"
- SetName(final_name)
- add_overlay(filling_overlay)
- add_overlay(panel_overlay)
+ if(panel_overlay)
+ add_overlay(panel_overlay)
diff --git a/code/game/objects/structures/fires.dm b/code/game/objects/structures/fires.dm
index 1b3832173b7e..273c685709aa 100644
--- a/code/game/objects/structures/fires.dm
+++ b/code/game/objects/structures/fires.dm
@@ -27,6 +27,7 @@
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
abstract_type = /obj/structure/fire_source
throwpass = TRUE
+ chem_volume = 100
// Counter for world.time, used to reduce lighting spam.
var/next_light_spam_guard = 0
@@ -75,7 +76,6 @@
/obj/structure/fire_source/Initialize()
. = ..()
update_icon()
- create_reagents(100)
steam = new(name)
steam.attach(get_turf(src))
steam.set_up(3, 0, get_turf(src))
@@ -250,7 +250,9 @@
/obj/structure/fire_source/proc/burn_material(var/decl/material/mat, var/amount)
var/effective_burn_temperature = get_effective_burn_temperature()
- . = mat.get_burn_products(amount, effective_burn_temperature)
+ var/datum/gas_mixture/environment = return_air() // todo: separate local and burn chamber gas mixes?
+ var/ambient_pressure = environment ? environment.return_pressure() : ONE_ATMOSPHERE
+ . = mat.get_burn_products(amount, effective_burn_temperature, ambient_pressure)
if(.)
if(mat.ignition_point && effective_burn_temperature >= mat.ignition_point)
if(mat.accelerant_value > FUEL_VALUE_NONE)
@@ -264,7 +266,7 @@
// This means that 100u (under two soup bowls full of water), will suppress a fire with 20 fuel.
fuel -= amount * (mat.accelerant_value / FUEL_VALUE_SUPPRESSANT) * 2
fuel = max(fuel, 0)
- loc.take_waste_burn_products(., effective_burn_temperature)
+ loc.take_waste_burn_products(., effective_burn_temperature, ambient_pressure)
// Dump waste gas from burned fuel.
/obj/structure/fire_source/proc/dump_waste_products(var/atom/target, var/list/waste)
@@ -363,19 +365,21 @@
return
if(reagents?.total_volume)
var/do_steam = FALSE
+ var/datum/gas_mixture/our_air = return_air()
+ var/ambient_pressure = our_air ? our_air.return_pressure() : ONE_ATMOSPHERE
var/list/waste = list()
for(var/decl/material/reagent as anything in reagents?.reagent_volumes)
- if(reagent.accelerant_value <= FUEL_VALUE_SUPPRESSANT && !isnull(reagent.boiling_point) && reagent.boiling_point < get_effective_burn_temperature())
+ if(reagent.accelerant_value <= FUEL_VALUE_SUPPRESSANT && reagent.phase_at_temperature(get_effective_burn_temperature(), ambient_pressure) == MAT_PHASE_GAS)
do_steam = TRUE
- var/volume = NONUNIT_CEILING(REAGENT_VOLUME(reagents, reagent) / REAGENT_UNITS_PER_GAS_MOLE, 0.1)
- var/list/waste_products = burn_material(reagent, volume)
+ var/result_amount = NONUNIT_CEILING(REAGENT_VOLUME(reagents, reagent) / REAGENT_UNITS_PER_GAS_MOLE, 0.1)
+ var/list/waste_products = burn_material(reagent, result_amount)
if(!isnull(waste_products))
for(var/product in waste_products)
waste[product] += waste_products[product]
- reagents.remove_reagent(reagent.type, volume)
+ reagents.remove_reagent(reagent.type, result_amount)
dump_waste_products(loc, waste)
diff --git a/code/game/objects/structures/fishtanks.dm b/code/game/objects/structures/fishtanks.dm
index 313c92a5ccd7..a8855275998b 100644
--- a/code/game/objects/structures/fishtanks.dm
+++ b/code/game/objects/structures/fishtanks.dm
@@ -25,21 +25,19 @@ var/global/list/fishtank_cache = list()
atom_flags = ATOM_FLAG_CHECKS_BORDER | ATOM_FLAG_CLIMBABLE
mob_offset = TRUE
max_health = 50
+ chem_volume = 300
var/deleting
var/fill_type
- var/fill_amt
var/obj/effect/glass_tank_overlay/tank_overlay // I don't like this, but there's no other way to get a mouse-transparent overlay :(
/obj/structure/glass_tank/aquarium
name = "aquarium"
desc = "A clear glass box for keeping specimens in. This one is full of water."
fill_type = /decl/material/liquid/water
- fill_amt = 300
/obj/structure/glass_tank/Initialize(mapload)
tank_overlay = new(loc, src)
- initialize_reagents()
. = ..()
update_icon()
if(!mapload)
@@ -53,16 +51,9 @@ var/global/list/fishtank_cache = list()
for(var/obj/structure/glass_tank/A in orange(1, oldloc))
A.update_icon()
-/obj/structure/glass_tank/initialize_reagents(populate = TRUE)
- if(!fill_amt)
- return
- create_reagents(fill_amt)
- if(!fill_type)
- return
- . = ..()
-
/obj/structure/glass_tank/populate_reagents()
- add_to_reagents(fill_type, reagents.maximum_volume)
+ if(fill_type)
+ add_to_reagents(fill_type, reagents.maximum_volume)
/obj/structure/glass_tank/attack_hand(var/mob/user)
if(user.check_intent(I_FLAG_HARM))
diff --git a/code/game/objects/structures/fountain.dm b/code/game/objects/structures/fountain.dm
index f596d169c6e0..d4287c844c53 100644
--- a/code/game/objects/structures/fountain.dm
+++ b/code/game/objects/structures/fountain.dm
@@ -10,6 +10,8 @@
pixel_x = -16
light_range = 5
light_power = 0.5
+ chem_volume = 500
+
var/used = FALSE
var/increase_age_prob = (100 / 6)
@@ -114,14 +116,6 @@
light_range = null
light_power = null
-/obj/structure/fountain/mundane/Initialize(ml, _mat, _reinf_mat)
- . = ..()
- initialize_reagents(ml)
-
-/obj/structure/fountain/mundane/initialize_reagents(populate = TRUE)
- create_reagents(500)
- . = ..()
-
/obj/structure/fountain/mundane/populate_reagents()
add_to_reagents(/decl/material/liquid/water, reagents.maximum_volume) //Don't give free water when building one
diff --git a/code/game/objects/structures/iv_drip.dm b/code/game/objects/structures/iv_drip.dm
index 796690f63565..e6dbe8176ab3 100644
--- a/code/game/objects/structures/iv_drip.dm
+++ b/code/game/objects/structures/iv_drip.dm
@@ -37,10 +37,9 @@
base.icon_state = "[beaker ? "beaker" : "nothing"][attached ? "_hooked" : ""]"
add_overlay(base)
- if(beaker)
- var/datum/reagents/reagents = beaker.reagents
- var/percent = round((reagents.total_volume / beaker.volume) * 100)
- if(reagents.total_volume)
+ if(beaker?.reagents)
+ var/percent = round((beaker.reagents.total_volume / beaker.reagents.maximum_volume) * 100)
+ if(beaker.reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance(icon, "reagent")
switch(percent)
if(0)
@@ -59,7 +58,7 @@
filling.icon_state = "reagent80"
if(91 to INFINITY)
filling.icon_state = "reagent100"
- filling.color = reagents.get_color()
+ filling.color = beaker.reagents.get_color()
add_overlay(filling)
if(istype(beaker, /obj/item/chems/ivbag))
@@ -120,7 +119,7 @@
return
if(mode) // Give blood
- if(beaker.volume > 0)
+ if(beaker.reagents?.total_volume > 0)
beaker.reagents.trans_to_mob(attached, transfer_amount, CHEM_INJECT)
queue_icon_update()
else // Take blood
@@ -193,7 +192,7 @@
. += "The IV drip is [mode ? "injecting" : "taking blood"]."
. += "It is set to transfer [transfer_amount]u of chemicals per cycle."
if(beaker)
- if(beaker.reagents && beaker.reagents.total_volume)
+ if(beaker.reagents?.total_volume)
. += SPAN_NOTICE("Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
else
. += SPAN_NOTICE("Attached is an empty [beaker].")
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 5d67e910f7cb..7f01952bc4b6 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -7,23 +7,19 @@
density = TRUE
atom_flags = ATOM_FLAG_OPEN_CONTAINER | ATOM_FLAG_CLIMBABLE
movable_flags = MOVABLE_FLAG_WHEELED
+ chem_volume = 180
+
var/obj/item/bag/trash/mybag = null
var/obj/item/mop/mymop = null
var/obj/item/chems/spray/myspray = null
var/obj/item/lightreplacer/myreplacer = null
var/signs = 0 //maximum capacity hardcoded below
-
-/obj/structure/janitorialcart/Initialize()
- . = ..()
- create_reagents(180)
-
/obj/structure/janitorialcart/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
if(distance <= 1)
. += "\The [src] [html_icon(src)] contains [reagents.total_volume] unit\s of liquid!"
-
/obj/structure/janitorialcart/attackby(obj/item/used_item, mob/user)
if(istype(used_item, /obj/item/bag/trash) && !mybag)
if(!user.try_unequip(used_item, src))
@@ -191,6 +187,7 @@
density = TRUE
material_alteration = MAT_FLAG_ALTERATION_NONE
atom_flags = ATOM_FLAG_OPEN_CONTAINER
+ chem_volume = 100
movement_handlers = list(
/datum/movement_handler/deny_multiz,
/datum/movement_handler/delay = list(1),
@@ -208,7 +205,6 @@
"[WEST]" = list("x" = 13, "y" = 7, "z" = 0)
)
. = ..()
- create_reagents(100)
/obj/structure/janicart/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index 22eec93ece55..57cc6d0e03f6 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -6,11 +6,7 @@
density = TRUE
w_class = ITEM_SIZE_NORMAL
atom_flags = ATOM_FLAG_CLIMBABLE | ATOM_FLAG_OPEN_CONTAINER
-
-
-/obj/structure/mopbucket/Initialize()
- . = ..()
- create_reagents(180)
+ chem_volume = 180
/obj/structure/mopbucket/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
diff --git a/code/game/objects/structures/pit.dm b/code/game/objects/structures/pit.dm
index 245e55bce956..09c8ee2cca5d 100644
--- a/code/game/objects/structures/pit.dm
+++ b/code/game/objects/structures/pit.dm
@@ -1,13 +1,13 @@
/obj/structure/pit
- name = "pit"
- desc = "Watch your step, partner."
- icon = 'icons/obj/structures/pit.dmi'
- icon_state = "pit1"
- blend_mode = BLEND_MULTIPLY
- density = FALSE
- anchored = TRUE
- current_health = ITEM_HEALTH_NO_DAMAGE //You can't break a hole in the ground.
- var/open = TRUE
+ name = "pit"
+ desc = "Watch your step, partner."
+ icon = 'icons/obj/structures/pit.dmi'
+ icon_state = "pit1"
+ blend_mode = BLEND_MULTIPLY
+ density = FALSE
+ anchored = TRUE
+ max_health = ITEM_HEALTH_NO_DAMAGE //You can't break a hole in the ground.
+ var/open = TRUE
/obj/structure/pit/attackby(obj/item/used_item, mob/user)
if(IS_SHOVEL(used_item))
@@ -200,7 +200,7 @@
icon_state = pick("wood","cross")
var/decl/background_detail/S = GET_DECL(/decl/background_detail/heritage/human)
- var/nam = S.get_random_name(null, pick(MALE,FEMALE))
+ var/nam = S.get_random_cultural_name(null, pick(MALE,FEMALE))
var/cur_year = global.using_map.game_year
var/born = cur_year - rand(5,150)
var/died = max(cur_year - rand(0,70),born)
diff --git a/code/game/objects/structures/structure_reagents.dm b/code/game/objects/structures/structure_reagents.dm
new file mode 100644
index 000000000000..f2d9decae039
--- /dev/null
+++ b/code/game/objects/structures/structure_reagents.dm
@@ -0,0 +1,47 @@
+/obj/structure/receive_mouse_drop(atom/dropping, mob/user, params)
+ if((. = ..()) || user?.get_active_held_item() != dropping || !isitem(dropping) || isnull(get_possible_reagent_transfer_amounts()))
+ return
+ // Awful. Sorry.
+ var/obj/item/item = dropping
+ var/old_atom_flags = atom_flags
+ atom_flags |= ATOM_FLAG_OPEN_CONTAINER
+ if(item.standard_pour_into(user, src))
+ . = TRUE
+ atom_flags = old_atom_flags
+
+/obj/structure/proc/get_reagent_amount_dispensed()
+ return null
+
+/obj/structure/proc/set_reagent_amount_dispensed()
+ return null
+
+/obj/structure/proc/set_reagent_amount_dispensed_verb()
+ set name = "Set amount dispensed"
+ set category = "Object"
+ set src in view(1)
+ if(!CanPhysicallyInteract(usr))
+ to_chat(usr, SPAN_NOTICE("You're in no condition to do that!"))
+ return
+ var/new_amount = input("Amount dispensed:","[src]") as null|anything in get_possible_reagent_transfer_amounts()
+ if(!CanPhysicallyInteract(usr)) // because input takes time and the situation can change
+ to_chat(usr, SPAN_NOTICE("You're in no condition to do that!'"))
+ return
+ if (new_amount)
+ set_reagent_amount_dispensed(new_amount)
+
+/obj/structure/proc/get_possible_reagent_transfer_amounts()
+ return null
+
+//Set amount dispensed. Added manually to querns and reagent dispensers.
+/decl/interaction_handler/set_transfer/structure
+ expected_target_type = /obj/structure
+
+/decl/interaction_handler/set_transfer/structure/is_possible(var/atom/target, var/mob/user)
+ . = ..()
+ if(.)
+ var/obj/structure/dispenser = target
+ return !isnull(dispenser.get_possible_reagent_transfer_amounts())
+
+/decl/interaction_handler/set_transfer/structure/invoked(atom/target, mob/user, obj/item/prop)
+ var/obj/structure/dispenser = target
+ dispenser.set_reagent_amount_dispensed_verb()
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 1778979d9b52..76b4a59db265 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -248,6 +248,7 @@ var/global/list/hygiene_props = list()
clogged = -1
can_drain = 1
drainage = 0.2 //showers are tiny, drain a little slower
+ chem_volume = 5
var/on = 0
var/next_mist = 0
@@ -259,11 +260,6 @@ var/global/list/hygiene_props = list()
var/datum/sound_token/sound_token
//add heat controls? when emagged, you can freeze to death in it?
-
-/obj/structure/hygiene/shower/Initialize()
- . = ..()
- create_reagents(5)
-
/obj/structure/hygiene/shower/Destroy()
QDEL_NULL(sound_token)
. = ..()
diff --git a/code/game/objects/structures/well.dm b/code/game/objects/structures/well.dm
index 911413e67e9b..9480d5721d51 100644
--- a/code/game/objects/structures/well.dm
+++ b/code/game/objects/structures/well.dm
@@ -14,7 +14,7 @@
wrenchable = FALSE
amount_dispensed = 10
possible_transfer_amounts = @"[10,25,50,100]"
- volume = 10000
+ chem_volume = 10000
can_toggle_open = FALSE
var/auto_refill
diff --git a/code/game/turfs/flooring/_flooring.dm b/code/game/turfs/flooring/_flooring.dm
index a4e97fe7d360..f5f8083873f8 100644
--- a/code/game/turfs/flooring/_flooring.dm
+++ b/code/game/turfs/flooring/_flooring.dm
@@ -9,6 +9,7 @@ var/global/list/flooring_cache = list()
/decl/flooring
abstract_type = /decl/flooring
+ decl_flags = DECL_FLAG_MANDATORY_UID
var/name
var/desc
diff --git a/code/game/turfs/flooring/flooring_carpet.dm b/code/game/turfs/flooring/flooring_carpet.dm
index 8c7be4c850f1..4236c3c2597b 100644
--- a/code/game/turfs/flooring/flooring_carpet.dm
+++ b/code/game/turfs/flooring/flooring_carpet.dm
@@ -11,6 +11,7 @@
footstep_type = /decl/footsteps/carpet
force_material = /decl/material/solid/organic/cloth
constructed = TRUE
+ uid = "floor_carpet"
burned_states = list(
"burned0",
"burned1"
@@ -27,49 +28,58 @@
name = "blue carpet"
icon_base = "blue1"
build_type = /obj/item/stack/tile/carpet/blue
+ uid = "floor_carpet_blue"
/decl/flooring/carpet/blue2
name = "pale blue carpet"
icon_base = "blue2"
build_type = /obj/item/stack/tile/carpet/blue2
+ uid = "floor_carpet_blue2"
/decl/flooring/carpet/blue3
name = "sea blue carpet"
icon_base = "blue3"
build_type = /obj/item/stack/tile/carpet/blue3
+ uid = "floor_carpet_blue3"
/decl/flooring/carpet/magenta
name = "magenta carpet"
icon_base = "purple"
build_type = /obj/item/stack/tile/carpet/magenta
+ uid = "floor_carpet_magenta"
/decl/flooring/carpet/purple
name = "purple carpet"
icon_base = "purple"
build_type = /obj/item/stack/tile/carpet/purple
+ uid = "floor_carpet_purple"
/decl/flooring/carpet/orange
name = "orange carpet"
icon_base = "orange"
build_type = /obj/item/stack/tile/carpet/orange
+ uid = "floor_carpet_orange"
/decl/flooring/carpet/green
name = "green carpet"
icon_base = "green"
build_type = /obj/item/stack/tile/carpet/green
+ uid = "floor_carpet_green"
/decl/flooring/carpet/red
name = "red carpet"
icon_base = "red"
build_type = /obj/item/stack/tile/carpet/red
+ uid = "floor_carpet_red"
/decl/flooring/carpet/rustic
- name = "rustic carpet"
- desc = "A stretch of simple woven carpet. Cozy, but a little itchy."
- icon = 'icons/turf/flooring/simple_carpet.dmi'
- icon_base = "carpet"
- build_type = /obj/item/stack/tile/carpet/rustic
- can_paint = TRUE
- color = null
- broken_states = null
- burned_states = null
+ name = "rustic carpet"
+ desc = "A stretch of simple woven carpet. Cozy, but a little itchy."
+ icon = 'icons/turf/flooring/simple_carpet.dmi'
+ icon_base = "carpet"
+ build_type = /obj/item/stack/tile/carpet/rustic
+ can_paint = TRUE
+ color = null
+ broken_states = null
+ burned_states = null
+ uid = "floor_carpet_rustic"
diff --git a/code/game/turfs/flooring/flooring_concrete.dm b/code/game/turfs/flooring/flooring_concrete.dm
index 4b747fc28d2c..e5d6edd5f174 100644
--- a/code/game/turfs/flooring/flooring_concrete.dm
+++ b/code/game/turfs/flooring/flooring_concrete.dm
@@ -6,14 +6,17 @@
has_base_range = null
force_material = /decl/material/solid/stone/concrete
constructed = TRUE
+ uid = "floor_concrete"
/decl/flooring/concrete/reinforced
name = "reinforced concrete"
icon_base = "hexacrete"
desc = "A flat stretch of stone-like artificial material. It has been reinforced with an unknown compound."
+ uid = "floor_concrete_reinf"
/decl/flooring/concrete/asphalt
name = "asphalt"
color = COLOR_GRAY40
icon_base = "concrete"
desc = "A stretch of rough blacktop, probably part of a road."
+ uid = "floor_asphalt"
diff --git a/code/game/turfs/flooring/flooring_grass.dm b/code/game/turfs/flooring/flooring_grass.dm
index bc340140b5d5..dc53aaf46808 100644
--- a/code/game/turfs/flooring/flooring_grass.dm
+++ b/code/game/turfs/flooring/flooring_grass.dm
@@ -13,6 +13,7 @@
flooring_flags = TURF_REMOVE_SHOVEL
force_material = /decl/material/solid/organic/plantmatter/grass
growth_value = 1.2 // Shouldn't really matter since you can't plant on grass, it turns to dirt first.
+ uid = "floor_grass"
var/harvestable = FALSE
/decl/flooring/grass/fire_act(turf/floor/target, datum/gas_mixture/air, exposed_temperature, exposed_volume)
@@ -33,6 +34,7 @@
has_base_range = null
icon_edge_layer = FLOOR_EDGE_GRASS_WILD
harvestable = TRUE
+ uid = "floor_grass_wild"
/decl/flooring/grass/wild/get_movable_alpha_mask_state(atom/movable/mover)
. = ..() || "mask_grass"
@@ -53,3 +55,4 @@
color = "#5e7a3b"
build_type = /obj/item/stack/tile/grass
force_material = /decl/material/solid/organic/plastic
+ uid = "floor_grass_fake"
diff --git a/code/game/turfs/flooring/flooring_holowater.dm b/code/game/turfs/flooring/flooring_holowater.dm
index d873db21a10e..6bfe235d67e1 100644
--- a/code/game/turfs/flooring/flooring_holowater.dm
+++ b/code/game/turfs/flooring/flooring_holowater.dm
@@ -8,3 +8,4 @@
footstep_type = /decl/footsteps/water
holographic = TRUE
constructed = TRUE
+ uid = "floor_water_fake"
diff --git a/code/game/turfs/flooring/flooring_lava.dm b/code/game/turfs/flooring/flooring_lava.dm
index d8137d15b356..adf4f4b4f1af 100644
--- a/code/game/turfs/flooring/flooring_lava.dm
+++ b/code/game/turfs/flooring/flooring_lava.dm
@@ -10,6 +10,7 @@
turf_light_color = LIGHT_COLOR_LAVA
turf_light_range = 2
turf_light_power = 0.7
+ uid = "floor_lava"
/decl/flooring/lava/handle_environment_proc(turf/floor/target)
. = PROCESS_KILL
diff --git a/code/game/turfs/flooring/flooring_misc.dm b/code/game/turfs/flooring/flooring_misc.dm
index d72c2f54d96d..893b2e72dee4 100644
--- a/code/game/turfs/flooring/flooring_misc.dm
+++ b/code/game/turfs/flooring/flooring_misc.dm
@@ -9,6 +9,7 @@
footstep_type = /decl/footsteps/tiles
force_material = /decl/material/solid/organic/plastic
constructed = TRUE
+ uid = "floor_lino"
/decl/flooring/crystal
name = "crystal flooring"
@@ -20,6 +21,7 @@
color = "#00ffe1"
force_material = /decl/material/solid/gemstone/crystal
constructed = TRUE
+ uid = "floor_crystal"
/decl/flooring/glass
name = "glass flooring"
@@ -37,6 +39,7 @@
z_flags = ZM_MIMIC_DEFAULTS
force_material = /decl/material/solid/glass
constructed = TRUE
+ uid = "floor_glass"
/decl/flooring/glass/boro
name = "borosilicate glass flooring"
@@ -44,6 +47,7 @@
color = GLASS_COLOR_SILICATE
damage_temperature = T0C + 4000
force_material = /decl/material/solid/glass/borosilicate
+ uid = "floor_glass_boro"
/decl/flooring/pool
name = "pool floor"
@@ -57,6 +61,7 @@
force_material = /decl/material/solid/stone/ceramic
constructed = TRUE
gender = NEUTER
+ uid = "floor_pool"
/decl/flooring/woven
name = "woven floor"
@@ -71,6 +76,7 @@
force_material = /decl/material/solid/organic/plantmatter/grass/dry
constructed = TRUE
gender = NEUTER
+ uid = "floor_woven"
/decl/flooring/straw
name = "straw floor"
@@ -86,3 +92,4 @@
force_material = /decl/material/solid/organic/plantmatter/grass/dry
constructed = TRUE
gender = NEUTER
+ uid = "floor_straw"
diff --git a/code/game/turfs/flooring/flooring_mud.dm b/code/game/turfs/flooring/flooring_mud.dm
index 6265343f2e7f..001a0c33ce90 100644
--- a/code/game/turfs/flooring/flooring_mud.dm
+++ b/code/game/turfs/flooring/flooring_mud.dm
@@ -11,6 +11,7 @@
growth_value = 1.1
can_collect = TRUE
print_type = /obj/effect/footprints
+ uid = "floor_mud"
/decl/flooring/mud/fire_act(turf/floor/target, datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(!target.reagents?.total_volume)
@@ -43,6 +44,7 @@
color = "#ae9e66"
dirt_color = "#ae9e66"
force_material = /decl/material/solid/soil
+ uid = "floor_dry_mud"
/decl/flooring/dry_mud/fluid_act(turf/floor/target, datum/reagents/fluids)
if(target.get_topmost_flooring() == src)
@@ -64,6 +66,7 @@
turf_flags = TURF_FLAG_BACKGROUND | TURF_IS_HOLOMAP_PATH | TURF_FLAG_ABSORB_LIQUID
force_material = /decl/material/solid/soil
growth_value = 1
+ uid = "floor_dirt"
/decl/flooring/dirt/fluid_act(turf/floor/target, datum/reagents/fluids)
if(target.get_topmost_flooring() == src)
diff --git a/code/game/turfs/flooring/flooring_natural.dm b/code/game/turfs/flooring/flooring_natural.dm
index 63d3b2ec93c5..128bdc34cbc4 100644
--- a/code/game/turfs/flooring/flooring_natural.dm
+++ b/code/game/turfs/flooring/flooring_natural.dm
@@ -8,6 +8,7 @@
force_material = /decl/material/solid/sand
gender = NEUTER
footstep_type = /decl/footsteps/sand
+ uid = "floor_seafloor"
/decl/flooring/shrouded
name = "packed sand"
@@ -19,6 +20,7 @@
turf_flags = TURF_FLAG_BACKGROUND | TURF_IS_HOLOMAP_PATH | TURF_FLAG_ABSORB_LIQUID
force_material = /decl/material/solid/sand
footstep_type = /decl/footsteps/asteroid
+ uid = "floor_shrouded"
/decl/flooring/meat
name = "fleshy ground"
@@ -30,6 +32,7 @@
footstep_type = /decl/footsteps/mud
force_material = /decl/material/solid/organic/meat
print_type = /obj/effect/footprints
+ uid = "floor_meat"
/decl/flooring/barren
name = "ground"
@@ -40,8 +43,9 @@
footstep_type = /decl/footsteps/asteroid
turf_flags = TURF_FLAG_BACKGROUND | TURF_IS_HOLOMAP_PATH
icon_edge_layer = FLOOR_EDGE_BARREN
- force_material = /decl/material/solid/soil
+ force_material = /decl/material/solid/sand
growth_value = 0.1
+ uid = "floor_barren"
/decl/flooring/clay
name = "clay"
@@ -55,6 +59,7 @@
growth_value = 1.2
can_collect = TRUE
print_type = /obj/effect/footprints
+ uid = "floor_clay"
/decl/flooring/ice
name = "ice"
@@ -63,6 +68,7 @@
icon_base = "ice"
color = COLOR_LIQUID_WATER
force_material = /decl/material/solid/ice
+ uid = "floor_ice"
/decl/flooring/ice/update_turf_icon(turf/floor/target)
. = ..()
diff --git a/code/game/turfs/flooring/flooring_path.dm b/code/game/turfs/flooring/flooring_path.dm
index cd821d713a86..6a934d5c5eb3 100644
--- a/code/game/turfs/flooring/flooring_path.dm
+++ b/code/game/turfs/flooring/flooring_path.dm
@@ -7,6 +7,7 @@
neighbour_type = /decl/flooring/path
color = null
constructed = TRUE
+ uid = "floor_path"
// If null, this is just skipped.
var/paving_adjective = "cobbled"
@@ -15,11 +16,11 @@
var/paver_noun = "stones"
/decl/flooring/path/update_turf_strings(turf/floor/target)
- var/decl/material/material = target?.get_material()
- ASSERT(material?.adjective_name)
+ var/decl/material/floor_material = target?.get_material()
+ ASSERT(floor_material?.adjective_name)
ASSERT(paver_noun)
- target.SetName("[material.adjective_name] [name]")
- target.desc = "[jointext_no_nulls(list("A", paving_adjective, "path made of", paver_adjective, material.adjective_name, paver_noun), " ")]."
+ target.SetName("[floor_material.adjective_name] [name]")
+ target.desc = "[jointext_no_nulls(list("A", paving_adjective, "path made of", paver_adjective, floor_material.adjective_name, paver_noun), " ")]."
/decl/flooring/path/cobblestone
name = "cobblestones"
@@ -28,6 +29,7 @@
icon_edge_layer = FLOOR_EDGE_PATH
flooring_flags = TURF_REMOVE_CROWBAR
has_base_range = 1
+ uid = "floor_path_cobble"
/decl/flooring/path/running_bond
name = "stone path"
@@ -35,6 +37,7 @@
icon_base = "runningbond"
has_base_range = 3
gender = NEUTER
+ uid = "floor_path_bond"
/decl/flooring/path/herringbone
name = "stone path"
@@ -42,3 +45,4 @@
icon_base = "herringbone"
has_base_range = null
gender = NEUTER
+ uid = "floor_path_herring"
diff --git a/code/game/turfs/flooring/flooring_plating.dm b/code/game/turfs/flooring/flooring_plating.dm
index 505bad7a3edc..2b51940d1336 100644
--- a/code/game/turfs/flooring/flooring_plating.dm
+++ b/code/game/turfs/flooring/flooring_plating.dm
@@ -17,3 +17,4 @@
"broken3",
"broken4"
)
+ uid = "floor_plating"
diff --git a/code/game/turfs/flooring/flooring_reinforced.dm b/code/game/turfs/flooring/flooring_reinforced.dm
index 97ce3b7302e4..38234d29ce8e 100644
--- a/code/game/turfs/flooring/flooring_reinforced.dm
+++ b/code/game/turfs/flooring/flooring_reinforced.dm
@@ -23,6 +23,7 @@
"broken3",
"broken4"
)
+ uid = "floor_reinf"
/decl/flooring/reinforced/circuit
name = "processing strata"
@@ -36,10 +37,12 @@
turf_light_range = 2
turf_light_power = 3
turf_light_color = COLOR_BLUE
+ uid = "floor_reinf_circ"
/decl/flooring/reinforced/circuit/green
icon_base = "gcircuit"
turf_light_color = COLOR_GREEN
+ uid = "floor_reinf_gcirc"
/decl/flooring/reinforced/circuit/red
icon_base = "rcircuit"
@@ -47,6 +50,7 @@
can_paint = FALSE
turf_light_power = 2
turf_light_color = COLOR_RED
+ uid = "floor_reinf_rcirc"
/decl/flooring/reinforced/shuttle
name = "floor"
@@ -57,24 +61,32 @@
can_paint = TRUE
can_engrave = FALSE
gender = NEUTER
+ uid = "floor_reinf_shuttle"
/decl/flooring/reinforced/shuttle/blue
icon_base = "floor"
+ uid = "floor_reinf_shuttle_blue"
/decl/flooring/reinforced/shuttle/yellow
icon_base = "floor2"
+ uid = "floor_reinf_shuttle_yellow"
/decl/flooring/reinforced/shuttle/white
icon_base = "floor3"
+ uid = "floor_reinf_shuttle_white"
/decl/flooring/reinforced/shuttle/red
icon_base = "floor4"
+ uid = "floor_reinf_shuttle_red"
/decl/flooring/reinforced/shuttle/purple
icon_base = "floor5"
+ uid = "floor_reinf_shuttle_purple"
/decl/flooring/reinforced/shuttle/darkred
icon_base = "floor6"
+ uid = "floor_reinf_shuttle_darkred"
/decl/flooring/reinforced/shuttle/black
icon_base = "floor7"
+ uid = "floor_reinf_shuttle_black"
diff --git a/code/game/turfs/flooring/flooring_rock.dm b/code/game/turfs/flooring/flooring_rock.dm
index 89b3fd455353..13836a0a7da7 100644
--- a/code/game/turfs/flooring/flooring_rock.dm
+++ b/code/game/turfs/flooring/flooring_rock.dm
@@ -7,9 +7,10 @@
color = null
icon_edge_layer = FLOOR_EDGE_VOLCANIC
gender = NEUTER
+ uid = "floor_reinf_shuttle_rock"
/decl/flooring/rock/update_turf_strings(turf/floor/target)
- var/decl/material/material = target?.get_material()
- ASSERT(material?.adjective_name)
- target.SetName("[material.adjective_name] [name]")
- target.desc = "An expanse of bare [material.solid_name]."
+ var/decl/material/turf_material = target?.get_material()
+ ASSERT(turf_material?.adjective_name)
+ target.SetName("[turf_material.adjective_name] [name]")
+ target.desc = "An expanse of bare [turf_material.solid_name]."
diff --git a/code/game/turfs/flooring/flooring_sand.dm b/code/game/turfs/flooring/flooring_sand.dm
index caf29c810493..3a7c0843f653 100644
--- a/code/game/turfs/flooring/flooring_sand.dm
+++ b/code/game/turfs/flooring/flooring_sand.dm
@@ -10,6 +10,7 @@
force_material = /decl/material/solid/sand
can_collect = TRUE
print_type = /obj/effect/footprints
+ uid = "floor_sand"
/decl/flooring/sand/fire_act(turf/floor/target, datum/gas_mixture/air, exposed_temperature, exposed_volume)
if((exposed_temperature > T0C + 1700 && prob(5)) || exposed_temperature > T0C + 3000)
@@ -31,15 +32,18 @@
color = "#d2e0b7"
dirt_color = "#d2e0b7"
footstep_type = /decl/footsteps/sand
+ uid = "floor_sand_chlorine"
/decl/flooring/sand/chlorine/marsh
name = "chlorine marsh"
desc = "A pool of noxious liquid chlorine. It's full of silt and plant matter."
+ uid = "floor_sand_chlorine_marsh"
/decl/flooring/sand/fake
name = "holosand"
desc = "Uncomfortably coarse and gritty for a hologram."
holographic = TRUE
+ uid = "floor_sand_fake"
/decl/flooring/fake_space
name = "\proper space"
@@ -49,6 +53,7 @@
has_base_range = 25
holographic = TRUE
gender = NEUTER
+ uid = "floor_space_fake"
/decl/flooring/melted_sand
name = "molten silica"
@@ -57,3 +62,4 @@
icon_base = "glass"
has_base_range = null
force_material = /decl/material/solid/glass
+ uid = "floor_sand_melted"
diff --git a/code/game/turfs/flooring/flooring_snow.dm b/code/game/turfs/flooring/flooring_snow.dm
index 8dabb7167af5..78e5b5f0b486 100644
--- a/code/game/turfs/flooring/flooring_snow.dm
+++ b/code/game/turfs/flooring/flooring_snow.dm
@@ -11,6 +11,7 @@
can_collect = TRUE
print_type = /obj/effect/footprints
drop_material_on_remove = TRUE
+ uid = "floor_snow"
/decl/flooring/snow/get_movement_delay(var/travel_dir, var/mob/mover)
. = ..()
@@ -51,8 +52,10 @@
icon = 'icons/turf/flooring/snow.dmi'
icon_base = "permafrost"
force_material = /decl/material/solid/ice
+ uid = "floor_permafrost"
/decl/flooring/snow/fake
name = "holosnow"
desc = "Not quite the same as snow on an entertainment terminal, but close."
holographic = TRUE
+ uid = "floor_snow_fake"
diff --git a/code/game/turfs/flooring/flooring_tiled.dm b/code/game/turfs/flooring/flooring_tiled.dm
index b8cf9e4c0154..e2b4af68c879 100644
--- a/code/game/turfs/flooring/flooring_tiled.dm
+++ b/code/game/turfs/flooring/flooring_tiled.dm
@@ -26,34 +26,41 @@
"broken3",
"broken4"
)
+ uid = "floor_tiled"
/decl/flooring/tiling/mono
icon_base = "monotile"
build_type = /obj/item/stack/tile/mono
+ uid = "floor_tiled_mono"
/decl/flooring/tiling/mono/dark
color = COLOR_DARK_GRAY
build_type = /obj/item/stack/tile/mono/dark
+ uid = "floor_tiled_dark_mono"
/decl/flooring/tiling/mono/white
icon_base = "monotile_light"
color = COLOR_OFF_WHITE
build_type = /obj/item/stack/tile/mono/white
+ uid = "floor_tiled_mono_white"
/decl/flooring/tiling/white
icon_base = "tiled_light"
desc = "A layer of sterile white tiles."
color = COLOR_OFF_WHITE
build_type = /obj/item/stack/tile/floor_white
+ uid = "floor_tiled_white"
/decl/flooring/tiling/dark
desc = "A layer of ominously dark tiles."
color = COLOR_DARK_GRAY
build_type = /obj/item/stack/tile/floor_dark
+ uid = "floor_tiled_dark"
/decl/flooring/tiling/dark/mono
icon_base = "monotile"
build_type = null
+ uid = "floor_tiled_dark_monotile"
/decl/flooring/tiling/freezer
desc = "A section of non-slip tiles suitable for a cool room or freezer."
@@ -61,48 +68,59 @@
color = null
flooring_flags = TURF_REMOVE_CROWBAR
build_type = /obj/item/stack/tile/floor_freezer
+ uid = "floor_tiled_freezer"
/decl/flooring/tiling/tech
icon = 'icons/turf/flooring/techfloor.dmi'
icon_base = "techfloor_gray"
build_type = /obj/item/stack/tile/techgrey
color = null
+ uid = "floor_tiled_tech"
/decl/flooring/tiling/tech/grid
icon_base = "techfloor_grid"
build_type = /obj/item/stack/tile/techgrid
+ uid = "floor_tiled_tech_grid"
/decl/flooring/tiling/new_tile
icon_base = "tile_full"
color = null
build_type = null
+ uid = "floor_tiled_new"
/decl/flooring/tiling/new_tile/cargo_one
icon_base = "cargo_one_full"
build_type = null
+ uid = "floor_tiled_cargo"
/decl/flooring/tiling/new_tile/kafel
icon_base = "kafel_full"
build_type = null
+ uid = "floor_tiled_kafel"
/decl/flooring/tiling/stone
icon_base = "stone"
build_type = /obj/item/stack/tile/stone
+ uid = "floor_tiled_stone"
/decl/flooring/tiling/new_tile/techmaint
icon_base = "techmaint"
build_type = /obj/item/stack/tile/techmaint
+ uid = "floor_tiled_techmaint"
/decl/flooring/tiling/new_tile/monofloor
icon_base = "monofloor"
color = COLOR_GUNMETAL
+ uid = "floor_tiled_monofloor"
/decl/flooring/tiling/new_tile/steel_grid
icon_base = "grid"
color = COLOR_GUNMETAL
build_type = /obj/item/stack/tile/grid
+ uid = "floor_tiled_steel_grid"
/decl/flooring/tiling/new_tile/steel_ridged
icon_base = "ridged"
color = COLOR_GUNMETAL
build_type = /obj/item/stack/tile/ridge
+ uid = "floor_tiled_steel_ridged"
diff --git a/code/game/turfs/flooring/flooring_wood.dm b/code/game/turfs/flooring/flooring_wood.dm
index d7352fb03ae2..20a479a891e0 100644
--- a/code/game/turfs/flooring/flooring_wood.dm
+++ b/code/game/turfs/flooring/flooring_wood.dm
@@ -22,30 +22,37 @@
"broken5",
"broken6"
)
+ uid = "floor_wood"
/decl/flooring/wood/mahogany
build_type = /obj/item/stack/tile/wood/mahogany
force_material = /decl/material/solid/organic/wood/mahogany
+ uid = "floor_wood_mahogany"
/decl/flooring/wood/maple
build_type = /obj/item/stack/tile/wood/maple
force_material = /decl/material/solid/organic/wood/maple
+ uid = "floor_wood_maple"
/decl/flooring/wood/ebony
build_type = /obj/item/stack/tile/wood/ebony
force_material = /decl/material/solid/organic/wood/ebony
+ uid = "floor_wood_ebony"
/decl/flooring/wood/walnut
build_type = /obj/item/stack/tile/wood/walnut
force_material = /decl/material/solid/organic/wood/walnut
+ uid = "floor_wood_walnut"
/decl/flooring/wood/bamboo
build_type = /obj/item/stack/tile/wood/bamboo
force_material = /decl/material/solid/organic/wood/bamboo
+ uid = "floor_wood_bamboo"
/decl/flooring/wood/yew
build_type = /obj/item/stack/tile/wood/yew
force_material = /decl/material/solid/organic/wood/yew
+ uid = "floor_wood_yew"
// Rough-hewn floors.
/decl/flooring/wood/rough
@@ -57,30 +64,37 @@
has_base_range = 3
build_type = /obj/item/stack/tile/wood/rough
broken_states = null
+ uid = "floor_wood_rough"
/decl/flooring/wood/rough/mahogany
build_type = /obj/item/stack/tile/wood/rough/mahogany
force_material = /decl/material/solid/organic/wood/mahogany
+ uid = "floor_wood_rough_mahogany"
/decl/flooring/wood/rough/maple
build_type = /obj/item/stack/tile/wood/rough/maple
force_material = /decl/material/solid/organic/wood/maple
+ uid = "floor_wood_rough_maple"
/decl/flooring/wood/rough/ebony
build_type = /obj/item/stack/tile/wood/rough/ebony
force_material = /decl/material/solid/organic/wood/ebony
+ uid = "floor_wood_rough_ebony"
/decl/flooring/wood/rough/walnut
build_type = /obj/item/stack/tile/wood/rough/walnut
force_material = /decl/material/solid/organic/wood/walnut
+ uid = "floor_wood_rough_walnut"
/decl/flooring/wood/rough/bamboo
build_type = /obj/item/stack/tile/wood/rough/bamboo
force_material = /decl/material/solid/organic/wood/bamboo
+ uid = "floor_wood_rough_bamboo"
/decl/flooring/wood/rough/yew
build_type = /obj/item/stack/tile/wood/rough/yew
force_material = /decl/material/solid/organic/wood/yew
+ uid = "floor_wood_rough_yew"
// Chipboard/wood laminate floors. Uses older icons.
/decl/flooring/laminate
@@ -106,23 +120,29 @@
"broken5",
"broken6"
)
+ uid = "floor_wood_lami"
/decl/flooring/laminate/mahogany
build_type = /obj/item/stack/tile/wood/laminate/mahogany
force_material = /decl/material/solid/organic/wood/chipboard/mahogany
+ uid = "floor_wood_lami_mahogany"
/decl/flooring/laminate/maple
build_type = /obj/item/stack/tile/wood/laminate/maple
force_material = /decl/material/solid/organic/wood/chipboard/maple
+ uid = "floor_wood_lami_maple"
/decl/flooring/laminate/ebony
build_type = /obj/item/stack/tile/wood/laminate/ebony
force_material = /decl/material/solid/organic/wood/chipboard/ebony
+ uid = "floor_wood_lami_ebony"
/decl/flooring/laminate/walnut
build_type = /obj/item/stack/tile/wood/laminate/walnut
force_material = /decl/material/solid/organic/wood/chipboard/walnut
+ uid = "floor_wood_lami_walnut"
/decl/flooring/laminate/yew
build_type = /obj/item/stack/tile/wood/laminate/yew
force_material = /decl/material/solid/organic/wood/chipboard/yew
+ uid = "floor_wood_lami_yew"
diff --git a/code/game/turfs/floors/_floor.dm b/code/game/turfs/floors/_floor.dm
index 22123008d757..d31643ba2deb 100644
--- a/code/game/turfs/floors/_floor.dm
+++ b/code/game/turfs/floors/_floor.dm
@@ -32,7 +32,12 @@
. = ..(ml)
- set_turf_materials(floor_material, skip_update = TRUE)
+ set_turf_materials(material, skip_update = TRUE)
+
+ if(istext(_flooring))
+ _flooring = resolve_decl_uid_list(cached_json_decode(_flooring))
+ if(!length(_flooring))
+ _flooring = null
if(!floortype && (ispath(_flooring) || islist(_flooring)))
floortype = _flooring
@@ -44,12 +49,11 @@
fill_to_zero_height() // try to refill turfs that act as fluid sources
- if(floor_material || get_topmost_flooring())
+ if(material || get_topmost_flooring())
update_from_flooring(skip_update = ml)
if(ml) // We skipped the update above to avoid updating our neighbors, but we need to update ourselves.
lazy_update_icon()
-
/turf/floor/ChangeTurf(turf/N, tell_universe, force_lighting_update, keep_air, update_open_turfs_above, keep_height)
if(is_processing)
STOP_PROCESSING(SSobj, src)
diff --git a/code/game/turfs/floors/floor_digging.dm b/code/game/turfs/floors/floor_digging.dm
index 123458d009cd..24a4f9edb132 100644
--- a/code/game/turfs/floors/floor_digging.dm
+++ b/code/game/turfs/floors/floor_digging.dm
@@ -25,22 +25,27 @@
return FALSE
return TRUE
-/turf/floor/can_dig_trench(tool_hardness = MAT_VALUE_MALLEABLE, using_tool = TOOL_SHOVEL)
- return can_be_dug(tool_hardness, using_tool) && get_physical_height() > -(FLUID_DEEP)
-
/turf/floor/dig_trench(mob/user, tool_hardness = MAT_VALUE_MALLEABLE, using_tool = TOOL_SHOVEL)
- if(flooring_is_diggable())
- handle_trench_digging(user)
+ if(!flooring_is_diggable())
+ return
-/turf/floor/proc/handle_trench_digging(mob/user)
var/decl/flooring/flooring = get_topmost_flooring()
if(!flooring.handle_turf_digging(src))
return
- // Only drop mats if we actually changed the turf height sufficiently.
+
var/old_height = get_physical_height()
var/new_height = max(old_height-TRENCH_DEPTH_PER_ACTION, -(FLUID_DEEP))
- var/height_diff = abs(old_height-new_height)
- if(height_diff >= TRENCH_DEPTH_PER_ACTION)
+ var/height_diff = round(abs(old_height-new_height))
+ if(new_height <= -(FLUID_DEEP))
+ var/open_turf_path = get_open_turf_type_by_area(src)
+ if(!open_turf_path)
+ to_chat(user, SPAN_WARNING("You cannot dig any lower!"))
+ return
+ to_chat(user, SPAN_DANGER("You break through \the [src]!"))
+ drop_diggable_resources(user)
+ ChangeTurf(open_turf_path)
+ // Only drop mats if we actually changed the turf height sufficiently.
+ else if(height_diff >= TRENCH_DEPTH_PER_ACTION)
drop_diggable_resources(user)
set_physical_height(new_height)
diff --git a/code/game/turfs/floors/floor_layers.dm b/code/game/turfs/floors/floor_layers.dm
index 5396b3607cf2..18cfa6f04fe9 100644
--- a/code/game/turfs/floors/floor_layers.dm
+++ b/code/game/turfs/floors/floor_layers.dm
@@ -9,8 +9,7 @@
if(islist(_flooring))
for(var/floor in _flooring)
. += RESOLVE_TO_DECL(floor)
- _flooring = . // ensure the list elements are resolved
- else
+ else if(!isnull(_flooring))
. += RESOLVE_TO_DECL(_flooring)
if(_base_flooring)
. += get_base_flooring()
diff --git a/code/game/turfs/floors/floor_materials.dm b/code/game/turfs/floors/floor_materials.dm
index 17dbe09f0a91..213deaca53b1 100644
--- a/code/game/turfs/floors/floor_materials.dm
+++ b/code/game/turfs/floors/floor_materials.dm
@@ -1,17 +1,14 @@
-/turf/floor
- VAR_PROTECTED/decl/material/floor_material
-
/turf/floor/set_turf_materials(decl/material/new_material, decl/material/new_reinf_material, force, decl/material/new_girder_material, skip_update)
if(ispath(new_material))
new_material = GET_DECL(new_material)
- if(floor_material != new_material || force)
- floor_material = new_material
- if(!istype(floor_material))
- if(floor_material)
- PRINT_STACK_TRACE("Floor turf has been supplied non-material '[istype(floor_material, /datum) ? floor_material.type : (floor_material || "NULL")]'.")
- floor_material = get_default_material()
+ if(material != new_material || force)
+ material = new_material
+ if(!istype(material))
+ if(material)
+ PRINT_STACK_TRACE("Floor turf has been supplied non-material '[istype(material, /datum) ? material.type : (material || "NULL")]'.")
+ material = get_default_material()
. = TRUE
if(. && !skip_update)
@@ -21,4 +18,4 @@
var/decl/flooring/flooring = get_topmost_flooring()
if(istype(flooring) && istype(flooring.force_material))
return flooring.force_material
- return floor_material
+ return material
diff --git a/code/game/turfs/floors/subtypes/floor_concrete.dm b/code/game/turfs/floors/subtypes/floor_concrete.dm
index 7e8056a04c70..60303ef1ee79 100644
--- a/code/game/turfs/floors/subtypes/floor_concrete.dm
+++ b/code/game/turfs/floors/subtypes/floor_concrete.dm
@@ -4,7 +4,7 @@
icon_state = "inset"
_flooring = /decl/flooring/concrete
_base_flooring = /decl/flooring/dirt
- floor_material = /decl/material/solid/stone/concrete
+ material = /decl/material/solid/stone/concrete
/turf/floor/concrete/smooth
icon_state = "concrete"
diff --git a/code/game/turfs/floors/subtypes/floor_misc.dm b/code/game/turfs/floors/subtypes/floor_misc.dm
index ad32a2b3b417..38d066540ce9 100644
--- a/code/game/turfs/floors/subtypes/floor_misc.dm
+++ b/code/game/turfs/floors/subtypes/floor_misc.dm
@@ -54,6 +54,9 @@
/turf/floor/plating
_base_flooring = /decl/flooring/plating // Setting here so overrides on /turf/floor do not impact explicitly typed plating turfs.
+/turf/floor/plating/flooded
+ flooded = /decl/material/liquid/water
+
// Dirt plating for Tradeship farms.
/turf/floor/plating/dirt
name = "dirt"
diff --git a/code/game/turfs/floors/subtypes/floor_natural.dm b/code/game/turfs/floors/subtypes/floor_natural.dm
index f265dea98b1f..ae7350535805 100644
--- a/code/game/turfs/floors/subtypes/floor_natural.dm
+++ b/code/game/turfs/floors/subtypes/floor_natural.dm
@@ -41,20 +41,13 @@
name = "snow"
icon = 'icons/turf/flooring/snow.dmi'
icon_state = "snow0"
- _flooring = list(
- /decl/flooring/grass,
- /decl/flooring/snow
- )
+ _flooring = @'["' + /decl/flooring/grass::uid + @'","' + /decl/flooring/snow::uid + @'"]'
/turf/floor/grass/wild
name = "wild grass"
icon = 'icons/turf/flooring/wildgrass.dmi'
icon_state = "wildgrass"
- _flooring = list(
- /decl/flooring/grass,
- /decl/flooring/grass/wild
- )
- _base_flooring = /decl/flooring/dirt
+ _flooring = @'["' + /decl/flooring/grass::uid + @'","' + /decl/flooring/grass/wild::uid + @'"]'
/turf/floor/ice
name = "ice"
diff --git a/code/game/turfs/floors/subtypes/floor_path.dm b/code/game/turfs/floors/subtypes/floor_path.dm
index 7d714f8efab9..b67e06bf1b70 100644
--- a/code/game/turfs/floors/subtypes/floor_path.dm
+++ b/code/game/turfs/floors/subtypes/floor_path.dm
@@ -1,18 +1,18 @@
/turf/floor/path
- name = "path"
- gender = NEUTER
- desc = "A cobbled path made of loose stones."
- color = COLOR_GRAY
- icon = 'icons/turf/flooring/path.dmi'
- icon_state = "cobble0"
- _flooring = /decl/flooring/path/cobblestone
- floor_material = /decl/material/solid/stone/sandstone
- _base_flooring = /decl/flooring/dirt
+ name = "path"
+ gender = NEUTER
+ desc = "A cobbled path made of loose stones."
+ color = COLOR_GRAY
+ icon = 'icons/turf/flooring/path.dmi'
+ icon_state = "cobble0"
+ _flooring = /decl/flooring/path/cobblestone
+ material = /decl/material/solid/stone/sandstone
+ _base_flooring = /decl/flooring/dirt
/turf/floor/path/Initialize(mapload, no_update_icon)
. = ..()
- set_turf_materials(floor_material || get_strata_material_type() || /decl/material/solid/stone/sandstone, skip_update = no_update_icon)
+ set_turf_materials(material || get_strata_material_type() || /decl/material/solid/stone/sandstone, skip_update = no_update_icon)
if(mapload && is_outside() && prob(20))
var/image/moss = image('icons/effects/decals/plant_remains.dmi', "leafy_bits", DECAL_LAYER)
moss.pixel_x = rand(-6, 6)
@@ -39,15 +39,15 @@
#define PATH_MATERIAL_SUBTYPES(material_name) \
/turf/floor/path/##material_name { \
color = /decl/material/solid/stone/##material_name::color; \
- floor_material = /decl/material/solid/stone/##material_name; \
+ material = /decl/material/solid/stone/##material_name; \
} \
/turf/floor/path/herringbone/##material_name { \
color = /decl/material/solid/stone/##material_name::color; \
- floor_material = /decl/material/solid/stone/##material_name; \
+ material = /decl/material/solid/stone/##material_name; \
} \
/turf/floor/path/running_bond/##material_name { \
color = /decl/material/solid/stone/##material_name::color; \
- floor_material = /decl/material/solid/stone/##material_name; \
+ material = /decl/material/solid/stone/##material_name; \
} \
/turf/floor/path/##material_name/water { \
color = COLOR_SKY_BLUE; \
diff --git a/code/game/turfs/floors/subtypes/floor_rock.dm b/code/game/turfs/floors/subtypes/floor_rock.dm
index de364ec1cc90..a0e1194fda70 100644
--- a/code/game/turfs/floors/subtypes/floor_rock.dm
+++ b/code/game/turfs/floors/subtypes/floor_rock.dm
@@ -6,12 +6,12 @@
/turf/floor/rock/Initialize(mapload, no_update_icon)
. = ..()
- set_turf_materials(floor_material || get_strata_material_type() || /decl/material/solid/stone/sandstone, skip_update = no_update_icon)
+ set_turf_materials(material || get_strata_material_type() || /decl/material/solid/stone/sandstone, skip_update = no_update_icon)
/turf/floor/rock/volcanic
- name = "volcanic floor"
- floor_material = /decl/material/solid/stone/basalt
+ name = "volcanic floor"
+ material = /decl/material/solid/stone/basalt
/turf/floor/rock/basalt
- color = /decl/material/solid/stone/basalt::color
- floor_material = /decl/material/solid/stone/basalt
+ color = /decl/material/solid/stone/basalt::color
+ material = /decl/material/solid/stone/basalt
diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm
index 3836af3e8072..abbcfecc695a 100644
--- a/code/game/turfs/open/_open.dm
+++ b/code/game/turfs/open/_open.dm
@@ -101,4 +101,45 @@
T.drill_act()
/turf/open/airless
- initial_gas = null
\ No newline at end of file
+ initial_gas = null
+
+/decl/interaction_handler/dig_ramp_from_above
+ name = "Dig Ramp From Above"
+ expected_target_type = /turf/open
+ examine_desc = "dig a ramp in the direction you are facing, one level down"
+
+/decl/interaction_handler/dig_ramp_from_above/is_possible(atom/target, mob/user, obj/item/prop)
+ . = ..()
+ if(.)
+ // TODO: check for blocking floors etc.
+ prop ||= user.get_usable_hand_slot_organ() // Allows drakes to dig.
+ if(!IS_PICK(prop) && !IS_SHOVEL(prop))
+ return FALSE
+ var/turf/turf = get_turf(target)
+ if(!istype(turf) || !turf.is_open() || !HasBelow(turf.z))
+ return FALSE
+ var/turf/wall/natural/wall = GetBelow(target)
+ if(!istype(wall))
+ return FALSE
+ if(!user.Adjacent(target))
+ return FALSE
+ return TRUE
+
+/decl/interaction_handler/dig_ramp_from_above/invoked(atom/target, mob/user, obj/item/prop)
+ var/turf/wall/natural/wall = GetBelow(target)
+ var/user_dir = get_dir(user, target) // opposite of regular wall carving as we are going downwards
+ if(!(user_dir in global.cardinal))
+ to_chat(user, SPAN_WARNING("You must be standing at a cardinal angle to create a ramp."))
+ return FALSE
+ prop ||= user.get_usable_hand_slot_organ() // Allows drakes to dig.
+ if(wall.material?.hardness > prop?.material?.hardness)
+ to_chat(user, SPAN_WARNING("Your [prop.name] is not hard enough to cut into \the [wall]."))
+ return FALSE
+ var/turf/wall/natural/support = get_step(wall, global.reverse_dir[user_dir])
+ if(!istype(support) || support.ramp_slope_direction)
+ to_chat(user, SPAN_WARNING("You cannot cut a ramp into a wall with no additional walls behind it."))
+ return FALSE
+ if(prop.do_tool_interaction((IS_PICK(prop) ? TOOL_PICK : TOOL_SHOVEL), user, wall, 3 SECONDS, suffix_message = ", forming it into a ramp") && !wall.ramp_slope_direction)
+ wall.make_ramp(user, user_dir)
+ return TRUE
+ return FALSE
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 285f4fc05c5c..36fa7f51f578 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -84,8 +84,6 @@
// Temporary list of weakrefs of atoms who should be excepted from falling into us
var/list/skip_height_fall_for
- var/paint_color
-
/// Floorlike structures like catwalks. Updated/retrieved by get_supporting_platform()
var/obj/structure/supporting_platform
@@ -250,10 +248,6 @@
T.try_build_turf(user, src)
return TRUE
- if(IS_HOE(used_item) && can_dig_farm(used_item.material?.hardness))
- try_dig_farm(user, used_item)
- return TRUE
-
if(IS_SHOVEL(used_item))
// TODO: move these checks into the interaction handlers.
@@ -274,8 +268,12 @@
to_chat(user, SPAN_WARNING("You cannot dig anything out of \the [src] with \the [used_item]."))
return TRUE
- var/decl/material/material = get_material()
- if(IS_PICK(used_item) && material)
+ if(IS_HOE(used_item) && can_dig_farm(used_item.material?.hardness))
+ try_dig_farm(user, used_item)
+ return TRUE
+
+ var/decl/material/digging_material = get_material()
+ if(IS_PICK(used_item) && digging_material)
// TODO: move these checks into the interaction handlers.
var/atom/platform = get_supporting_platform()
@@ -283,7 +281,7 @@
to_chat(user, SPAN_WARNING("\The [platform] [platform.get_pronouns().is] in the way!"))
return TRUE
- if(material?.hardness <= MAT_VALUE_FLEXIBLE)
+ if(digging_material?.hardness <= MAT_VALUE_FLEXIBLE)
to_chat(user, SPAN_WARNING("\The [src] is too soft to be excavated with \the [used_item]. Use a shovel."))
return TRUE
@@ -644,7 +642,7 @@
return zone.air?.graphic
if(external_atmosphere_participation && is_outside())
var/datum/level_data/level = SSmapping.levels_by_z[z]
- return level.exterior_atmosphere.graphic
+ return level.exterior_atmosphere?.graphic
var/datum/gas_mixture/environment = return_air()
return environment?.graphic
@@ -825,12 +823,7 @@
return null
/turf/get_color()
- if(paint_color)
- return paint_color
- var/decl/material/material = get_material()
- if(material)
- return material.color
- return color
+ return paint_color || get_material()?.color || color
/turf/proc/get_fishing_result(obj/item/food/bait)
var/area/A = get_area(src)
@@ -856,26 +849,33 @@
var/obj/item/held = user ? (user.get_active_held_item() || user.get_usable_hand_slot_organ()) : null
if(!istype(held))
return
- if(IS_SHOVEL(held))
- if(can_dig_pit(held.material?.hardness))
- LAZYADD(., /decl/interaction_handler/dig/pit)
- if(can_dig_trench(held.material?.hardness))
+ if(is_open())
+ if(HasBelow(z))
+ LAZYADD(., /decl/interaction_handler/dig_ramp_from_above)
+ else
+ if(IS_SHOVEL(held))
+ if(can_dig_pit(held.material?.hardness))
+ LAZYADD(., /decl/interaction_handler/dig/pit)
+ if(can_dig_trench(held.material?.hardness))
+ LAZYADD(., /decl/interaction_handler/dig/trench)
+ if(IS_PICK(held) && can_dig_trench(held.material?.hardness, using_tool = TOOL_PICK))
LAZYADD(., /decl/interaction_handler/dig/trench)
- if(IS_PICK(held) && can_dig_trench(held.material?.hardness, using_tool = TOOL_PICK))
- LAZYADD(., /decl/interaction_handler/dig/trench)
- if(IS_HOE(held) && can_dig_farm(held.material?.hardness))
- LAZYADD(., /decl/interaction_handler/dig/farm)
+ if(IS_HOE(held) && can_dig_farm(held.material?.hardness))
+ LAZYADD(., /decl/interaction_handler/dig/farm)
/// Contaminant may be the chemical decl of the footprint being provided,
/// or null if we just want to know if we support footprints, at all, ever.
/turf/proc/can_show_coating_footprints(decl/material/contaminant)
return simulated
+/turf/proc/is_purged()
+ return
+
/decl/interaction_handler/show_turf_contents
name = "Show Turf Contents"
expected_user_type = /mob
interaction_flags = 0
- examine_desc = "list everything on $TARGET_THEM$"
+ examine_desc = "list everything on the turf"
/decl/interaction_handler/show_turf_contents/invoked(atom/target, mob/user, obj/item/prop)
target.show_atom_list_for_turf(user, get_turf(target))
@@ -903,8 +903,8 @@
if(T.can_dig_trench(prop?.material?.hardness))
T.try_dig_trench(user, prop)
else if(IS_PICK(prop))
- var/decl/material/material = T.get_material()
- if(material?.hardness > MAT_VALUE_FLEXIBLE && T.can_dig_trench(prop?.material?.hardness, using_tool = TOOL_PICK))
+ var/decl/material/digging_material = T.get_material()
+ if(digging_material?.hardness > MAT_VALUE_FLEXIBLE && T.can_dig_trench(prop?.material?.hardness, using_tool = TOOL_PICK))
T.try_dig_trench(user, prop, using_tool = TOOL_PICK)
/decl/interaction_handler/dig/pit
@@ -929,5 +929,3 @@
/turf/take_vaporized_reagent(reagent, amount)
return assume_gas(reagent, round(amount / REAGENT_UNITS_PER_GAS_MOLE))
-
-/turf/proc/is_purged()
\ No newline at end of file
diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm
index ac2e306ea590..dedebcfc16aa 100644
--- a/code/game/turfs/turf_changing.dm
+++ b/code/game/turfs/turf_changing.dm
@@ -188,6 +188,11 @@
for(var/atom/movable/AM as anything in changed_turf)
AM.update_turf_alpha_mask()
+ // Anything on our turf needs to fall down.
+ if(HasBelow(z) && changed_turf.is_open() && !old_is_open)
+ for(var/atom/movable/thing in changed_turf.get_contained_external_atoms())
+ thing.fall()
+
/turf/proc/transport_properties_from(turf/other, transport_air)
if(transport_air && can_inherit_air && (other.zone || other.air))
if(!air)
diff --git a/code/game/turfs/turf_digging.dm b/code/game/turfs/turf_digging.dm
index 5f832ae8045c..41be30031860 100644
--- a/code/game/turfs/turf_digging.dm
+++ b/code/game/turfs/turf_digging.dm
@@ -35,6 +35,9 @@
to_chat(user, SPAN_NOTICE("You unearth \a [thing]!"))
LAZYADD(., loot)
+ for(var/obj/item/stack/stack in .)
+ stack.add_to_stacks()
+
clear_diggable_resources()
// Procs for digging pits.
@@ -54,8 +57,8 @@
return get_plant_growth_rate() > 0 && can_be_dug(tool_hardness, using_tool) && !(locate(/obj/machinery/portable_atmospherics/hydroponics/soil) in src)
/turf/proc/try_dig_farm(mob/user, obj/item/tool, using_tool = TOOL_HOE)
- var/decl/material/material = get_material()
- if(!material?.tillable)
+ var/decl/material/turf_material = get_material()
+ if(!turf_material?.tillable)
return
if((!user && !tool) || tool.do_tool_interaction(using_tool, user, src, 5 SECONDS, set_cooldown = TRUE, check_skill = SKILL_BOTANY))
return dig_farm(user, tool?.material?.hardness, using_tool)
@@ -66,7 +69,7 @@
// Proc for digging trenches.
/turf/proc/can_dig_trench(tool_hardness = MAT_VALUE_MALLEABLE, using_tool = TOOL_SHOVEL)
- return can_be_dug(tool_hardness, using_tool) && get_physical_height() > -(FLUID_DEEP)
+ return can_be_dug(tool_hardness, using_tool) && (HasBelow(z) || get_physical_height() > -(FLUID_DEEP))
/turf/proc/try_dig_trench(mob/user, obj/item/tool, using_tool = TOOL_SHOVEL)
if((!user && !tool) || tool.do_tool_interaction(using_tool, user, src, 2.5 SECONDS, check_skill = SKILL_HAULING, set_cooldown = TRUE))
diff --git a/code/game/turfs/turf_fluids.dm b/code/game/turfs/turf_fluids.dm
index 48c6e74fc863..bb59234398df 100644
--- a/code/game/turfs/turf_fluids.dm
+++ b/code/game/turfs/turf_fluids.dm
@@ -106,18 +106,15 @@
ADD_ACTIVE_FLUID(src)
/turf/get_reagents()
- if(!reagents)
- create_reagents(FLUID_MAX_DEPTH)
+ create_or_update_reagents(FLUID_MAX_DEPTH)
return ..()
/turf/add_to_reagents(reagent_type, amount, data, safety = FALSE, defer_update = FALSE, phase = null)
- if(!reagents)
- create_reagents(FLUID_MAX_DEPTH)
+ create_or_update_reagents(FLUID_MAX_DEPTH)
return ..()
/turf/get_reagent_space()
- if(!reagents)
- create_reagents(FLUID_MAX_DEPTH)
+ create_or_update_reagents(FLUID_MAX_DEPTH)
return ..()
/turf/fluid_act(var/datum/reagents/fluids)
@@ -146,8 +143,7 @@
// No flowing of reagents without liquids, but this proc should not be called if liquids are not present regardless.
if(!reagents?.total_liquid_volume)
return
- if(!target.reagents)
- target.create_reagents(FLUID_MAX_DEPTH)
+ target.create_or_update_reagents(FLUID_MAX_DEPTH)
// We reference total_volume instead of total_liquid_volume here because the maximum volume limits of the turfs still respect solid volumes, and depth is still determined by total volume.
reagents.trans_to_turf(target, min(reagents.total_volume, min(target.reagents.maximum_volume - target.reagents.total_volume, amount)), defer_update = defer_update)
diff --git a/code/game/turfs/walls/_wall.dm b/code/game/turfs/walls/_wall.dm
index ef02c8f94328..1d26dbb74a65 100644
--- a/code/game/turfs/walls/_wall.dm
+++ b/code/game/turfs/walls/_wall.dm
@@ -36,8 +36,6 @@ var/global/list/wall_fullblend_objects = list(
var/unique_merge_identifier
var/damage = 0
var/can_open = 0
- var/decl/material/material
- var/decl/material/reinf_material
var/decl/material/girder_material = /decl/material/solid/metal/steel
var/construction_stage
var/hitsound = 'sound/weapons/Genhit.ogg'
@@ -123,10 +121,6 @@ var/global/list/wall_fullblend_objects = list(
if(!radiate())
return PROCESS_KILL
-/turf/wall/get_material()
- RETURN_TYPE(/decl/material)
- return material
-
/turf/wall/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj,/obj/item/projectile/beam))
burn(2500)
diff --git a/code/game/turfs/walls/wall_engraving.dm b/code/game/turfs/walls/wall_engraving.dm
new file mode 100644
index 000000000000..ee730aa2a220
--- /dev/null
+++ b/code/game/turfs/walls/wall_engraving.dm
@@ -0,0 +1,16 @@
+/datum/engraving
+ var/name = "nondescript design"
+ var/desc
+ var/icon
+ var/icon_state
+ var/dir
+
+/datum/engraving/New(var/decl/banner_symbol/engraving_symbol)
+ if(engraving_symbol)
+ icon = engraving_symbol.icon
+ icon_state = engraving_symbol.icon_state
+ name = engraving_symbol.name
+
+/datum/engraving/random/New()
+ var/banner_decls = decls_repository.get_decls_of_subtype_unassociated(/decl/banner_symbol)
+ ..(pick(banner_decls))
diff --git a/code/game/turfs/walls/wall_natural.dm b/code/game/turfs/walls/wall_natural.dm
index 095e8f7ed26e..4710e89e5626 100644
--- a/code/game/turfs/walls/wall_natural.dm
+++ b/code/game/turfs/walls/wall_natural.dm
@@ -1,3 +1,5 @@
+var/global/_wall_chisel_skill = SKILL_CONSTRUCTION
+
/turf/wall/natural
icon_state = "natural"
desc = "A rough natural wall."
@@ -11,6 +13,8 @@
var/static/list/exterior_wall_shine_cache = list()
var/being_mined = FALSE
var/gem_dropped = FALSE
+ var/smoothed
+ var/list/engravings
/turf/wall/natural/flooded
flooded = /decl/material/liquid/water
@@ -20,7 +24,7 @@
return SPAN_NOTICE("It has been noticeably discoloured by the elements.")
/turf/wall/natural/get_wall_icon()
- return 'icons/turf/walls/natural.dmi'
+ return (smoothed && !ramp_slope_direction) ? 'icons/turf/walls/stone.dmi' : 'icons/turf/walls/natural.dmi'
/turf/wall/natural/Initialize(var/ml, var/materialtype, var/rmaterialtype)
. = ..()
@@ -50,9 +54,23 @@
update_neighboring_ramps(destroying_self = TRUE)
. = ..()
+/turf/wall/natural/proc/get_engraving_for_dir(facing_dir)
+ for(var/datum/engraving/engraving in engravings)
+ if(engraving.dir == facing_dir)
+ return engraving
+
+/turf/wall/natural/attack_hand(mob/user)
+
+ // Allow species with digging limbs to dig (drakes)
+ var/obj/item/prop = user.get_usable_hand_slot_organ()
+ if(istype(prop))
+ return attackby(prop, user)
+
+ . = ..()
+
/turf/wall/natural/attackby(obj/item/used_item, mob/user, click_params)
- if(user.check_dexterity(DEXTERITY_COMPLEX_TOOLS) && !ramp_slope_direction)
+ if(!ramp_slope_direction && user.check_dexterity(DEXTERITY_COMPLEX_TOOLS, silent = TRUE))
if(istype(used_item, /obj/item/depth_scanner))
var/obj/item/depth_scanner/C = used_item
@@ -93,12 +111,39 @@
return FALSE
/turf/wall/natural/update_strings()
+ var/modifier
+ if(length(engravings))
+ modifier = "engraved"
+ else if(smoothed)
+ if(reinf_material)
+ modifier = "polished"
+ else
+ modifier = "smooth"
+ else if(!reinf_material)
+ modifier = "natural"
+
if(reinf_material)
- SetName("[reinf_material.ore_name] deposit")
- desc = "A natural cliff face composed of bare [material.solid_name] and a deposit of [reinf_material.ore_name]."
+ if(modifier)
+ SetName("[modifier] [reinf_material.ore_name] deposit")
+ else
+ SetName("[reinf_material.ore_name] deposit")
+ desc = "A natural wall composed of bare [material.solid_name] and a deposit of [reinf_material.ore_name]."
else
- SetName("natural [material.solid_name] wall")
- desc = "A natural cliff face composed of bare [material.solid_name]."
+ SetName("[modifier] [material.solid_name] wall")
+ desc = "A natural wall composed of bare [material.solid_name]."
+
+/turf/wall/natural/get_examine_strings(mob/user, distance, infix, suffix)
+ . = ..()
+ if(length(engravings))
+ for(var/datum/engraving/engraving in engravings)
+ var/engraving_line
+ if(engraving.name)
+ engraving_line = "It has been engraved with \a [engraving.name]."
+ else
+ engraving_line = "It has been engraved."
+ if(engraving.desc)
+ engraving_line = "[engraving_line] [engraving.desc]"
+ . += engraving_line
/turf/wall/natural/update_material(var/update_neighbors)
if(reinf_material?.ore_icon_overlay)
diff --git a/code/game/turfs/walls/wall_natural_icon.dm b/code/game/turfs/walls/wall_natural_icon.dm
index e0231caf658a..715297e7339b 100644
--- a/code/game/turfs/walls/wall_natural_icon.dm
+++ b/code/game/turfs/walls/wall_natural_icon.dm
@@ -66,8 +66,6 @@
else if(has_right_neighbor)
state = "ramp-blend-right"
var/image/I = image(material_icon_base, state, dir = ramp_slope_direction)
- I.color = base_color
- I.appearance_flags |= RESET_COLOR
add_overlay(I)
if(shine)
I = image(material_icon_base, "[state]-shine", dir = ramp_slope_direction)
@@ -94,3 +92,24 @@
add_overlay(excav_overlay)
if(archaeo_overlay)
add_overlay(archaeo_overlay)
+
+ // Might be worth having a dedicated wall engraving icon set in the future instead of using the banner/sign symbols.
+ // That would let us avoid this offsetting stuff and make the icons look less wonky on foreshortened faces.
+ for(var/datum/engraving/engraving in engravings)
+ // Not aware of a nice way to handle this. Would like to use BLEND_INSET_OVERLAY but we need BLEND_MULTIPLY.
+ if(engraving.dir == NORTH || !engraving.icon || !engraving.icon_state)
+ continue
+
+ var/y_offset = 9
+ var/x_offset = 0
+ if(engraving.dir == SOUTH)
+ y_offset = 0
+ else if(engraving.dir == EAST)
+ x_offset = -1
+ else if(engraving.dir == WEST)
+ x_offset = 1
+
+ var/image/eng = image(icon = engraving.icon, icon_state = engraving.icon_state, dir = engraving.dir, pixel_x = x_offset, pixel_y = y_offset)
+ eng.blend_mode = BLEND_MULTIPLY
+ add_overlay(eng)
+
diff --git a/code/game/turfs/walls/wall_natural_ramps.dm b/code/game/turfs/walls/wall_natural_ramps.dm
index 760c4a01f0d5..3ec738ff1221 100644
--- a/code/game/turfs/walls/wall_natural_ramps.dm
+++ b/code/game/turfs/walls/wall_natural_ramps.dm
@@ -1,9 +1,13 @@
/turf/wall/natural/proc/make_ramp(var/mob/user, var/new_slope, var/skip_icon_update = FALSE)
ramp_slope_direction = new_slope
+ QDEL_NULL_LIST(engravings)
var/old_ao = permit_ao
if(ramp_slope_direction)
+
+ user?.visible_message(SPAN_NOTICE("\The [user] digs out \the [src], forming a ramp."))
+
drop_ore()
permit_ao = FALSE
blocks_air = FALSE
@@ -23,6 +27,9 @@
update_neighboring_ramps()
else
+
+ user?.visible_message(SPAN_NOTICE("\The [user] clears out \the [src]."))
+
permit_ao = initial(permit_ao)
blocks_air = initial(blocks_air)
density = initial(density)
@@ -49,17 +56,18 @@
/turf/wall/natural/get_alt_interactions(mob/user)
. = ..()
- LAZYADD(., /decl/interaction_handler/drill_ramp)
+ LAZYADD(., /decl/interaction_handler/dig_ramp)
-/decl/interaction_handler/drill_ramp
- name = "Drill Ramp"
+/decl/interaction_handler/dig_ramp
+ name = "Dig Ramp"
expected_target_type = /turf/wall/natural
- examine_desc = "drill a ramp in the direction you are facing"
+ examine_desc = "dig a ramp in the direction you are facing"
-/decl/interaction_handler/drill_ramp/is_possible(atom/target, mob/user, obj/item/prop)
+/decl/interaction_handler/dig_ramp/is_possible(atom/target, mob/user, obj/item/prop)
. = ..()
if(.)
- if(!IS_PICK(prop))
+ prop ||= user.get_usable_hand_slot_organ() // Allows drakes to dig.
+ if(!IS_PICK(prop) && !IS_SHOVEL(prop))
return FALSE
var/turf/wall/natural/wall = target
if(!HasAbove(wall.z))
@@ -68,17 +76,21 @@
return FALSE
return TRUE
-/decl/interaction_handler/drill_ramp/invoked(atom/target, mob/user, obj/item/prop)
+/decl/interaction_handler/dig_ramp/invoked(atom/target, mob/user, obj/item/prop)
var/turf/wall/natural/wall = target
var/user_dir = get_dir(wall, user)
if(!(user_dir in global.cardinal))
to_chat(user, SPAN_WARNING("You must be standing at a cardinal angle to create a ramp."))
return FALSE
+ prop ||= user.get_usable_hand_slot_organ() // Allows drakes to dig.
+ if(wall.material?.hardness > prop?.material?.hardness)
+ to_chat(user, SPAN_WARNING("Your [prop.name] is not hard enough to cut into \the [wall]."))
+ return FALSE
var/turf/wall/natural/support = get_step(wall, global.reverse_dir[user_dir])
if(!istype(support) || support.ramp_slope_direction)
to_chat(user, SPAN_WARNING("You cannot cut a ramp into a wall with no additional walls behind it."))
return FALSE
- if(prop.do_tool_interaction(TOOL_PICK, user, wall, 3 SECONDS, suffix_message = ", forming it into a ramp") && !wall.ramp_slope_direction)
+ if(prop.do_tool_interaction((IS_PICK(prop) ? TOOL_PICK : TOOL_SHOVEL), user, wall, 3 SECONDS, suffix_message = ", forming it into a ramp") && !wall.ramp_slope_direction)
wall.make_ramp(user, user_dir)
return TRUE
return FALSE
diff --git a/code/modules/ZAS/Fire.dm b/code/modules/ZAS/Fire.dm
index b4b955ecf4e1..8e68d92a22f9 100644
--- a/code/modules/ZAS/Fire.dm
+++ b/code/modules/ZAS/Fire.dm
@@ -112,15 +112,15 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin
for(var/mob/living/L in loc)
L.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure()) //Burn the mobs!
- loc.fire_act(air_contents, air_contents.temperature, air_contents.volume)
+ loc.fire_act(air_contents, air_contents.temperature, air_contents.total_volume)
for(var/atom/A in loc)
- A.fire_act(air_contents, air_contents.temperature, air_contents.volume)
+ A.fire_act(air_contents, air_contents.temperature, air_contents.total_volume)
// prioritize nearby fuel overlays first
for(var/direction in global.cardinal)
var/turf/enemy_tile = get_step(my_tile, direction)
if(istype(enemy_tile) && enemy_tile.reagents)
- enemy_tile.hotspot_expose(air_contents.temperature, air_contents.volume)
+ enemy_tile.hotspot_expose(air_contents.temperature, air_contents.total_volume)
//spread
for(var/direction in global.cardinal)
@@ -141,7 +141,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin
enemy_tile.create_fire(firelevel)
else
- enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume)
+ enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.total_volume)
animate(src, color = fire_color(air_contents.temperature), 5)
set_light(l_color = color)
@@ -209,8 +209,8 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin
var/reaction_limit = min(total_oxidizers*(FIRE_REACTION_FUEL_AMOUNT/FIRE_REACTION_OXIDIZER_AMOUNT), total_fuel) //stoichiometric limit
//vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn).)
- var/firelevel = calculate_firelevel(total_fuel, total_oxidizers, reaction_limit, volume*group_multiplier) / vsc.fire_firelevel_multiplier
- var/min_burn = 0.30*volume*group_multiplier/CELL_VOLUME //in moles - so that fires with very small gas concentrations burn out fast
+ var/firelevel = calculate_firelevel(total_fuel, total_oxidizers, reaction_limit, total_volume*group_multiplier) / vsc.fire_firelevel_multiplier
+ var/min_burn = 0.30*total_volume*group_multiplier/CELL_VOLUME //in moles - so that fires with very small gas concentrations burn out fast
var/total_reaction_progress = min(max(min_burn, firelevel*total_fuel)*FIRE_GAS_BURNRATE_MULT, total_fuel)
var/used_fuel = min(total_reaction_progress, reaction_limit)
var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT)
diff --git a/code/modules/ZAS/Zone.dm b/code/modules/ZAS/Zone.dm
index 8b3f477a586b..cac84cb69bf5 100644
--- a/code/modules/ZAS/Zone.dm
+++ b/code/modules/ZAS/Zone.dm
@@ -57,7 +57,7 @@ Class Procs:
SSair.add_zone(src)
air.temperature = TCMB
air.group_multiplier = 1
- air.volume = CELL_VOLUME
+ air.total_volume = CELL_VOLUME
/zone/proc/add(turf/T)
#ifdef ZASDBG
@@ -136,7 +136,7 @@ Class Procs:
CHECK_TICK
/zone/proc/add_tile_air(datum/gas_mixture/tile_air)
- //air.volume += CELL_VOLUME
+ //air.total_volume += CELL_VOLUME
air.group_multiplier = 1
air.multiply(contents.len)
air.merge(tile_air)
@@ -200,7 +200,7 @@ Class Procs:
for(var/g in air.gas)
var/decl/material/mat = GET_DECL(g)
to_chat(M, "[capitalize(mat.gas_name)]: [air.gas[g]]")
- to_chat(M, "P: [air.return_pressure()] kPa V: [air.volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)")
+ to_chat(M, "P: [air.return_pressure()] kPa V: [air.total_volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)")
to_chat(M, "O2 per N2: [(air.gas[/decl/material/gas/nitrogen] ? air.gas[/decl/material/gas/oxygen]/air.gas[/decl/material/gas/nitrogen] : "N/A")] Moles: [air.total_moles]")
to_chat(M, "Simulated: [contents.len] ([air.group_multiplier])")
to_chat(M, "Edges: [length(edges)]")
diff --git a/code/modules/abstract/corpse_spawner.dm b/code/modules/abstract/corpse_spawner.dm
index 47319d03325b..c7b3197e5c95 100644
--- a/code/modules/abstract/corpse_spawner.dm
+++ b/code/modules/abstract/corpse_spawner.dm
@@ -90,7 +90,7 @@
var/decl/background_detail/background = M.get_background_datum_by_flag(BACKGROUND_FLAG_NAMING)
if(background && CORPSE_SPAWNER_RANDOM_NAME & spawn_flags)
- M.SetName(background.get_random_name(M.gender))
+ M.SetName(background.get_random_cultural_name(M, M.gender, M.get_species()))
else
M.SetName(name)
M.real_name = M.name
diff --git a/code/modules/admin/secrets/fun_secrets/break_all_lights.dm b/code/modules/admin/secrets/fun_secrets/break_all_lights.dm
index 114a6ae96dff..51a5131e92d7 100644
--- a/code/modules/admin/secrets/fun_secrets/break_all_lights.dm
+++ b/code/modules/admin/secrets/fun_secrets/break_all_lights.dm
@@ -4,6 +4,6 @@
/datum/admin_secret_item/fun_secret/break_all_lights/execute(var/mob/user)
. = ..()
if(.)
- for(var/obj/machinery/power/apc/apc in SSmachines.machinery)
+ for(var/obj/machinery/apc/apc in SSmachines.machinery)
apc.overload_lighting()
CHECK_TICK
diff --git a/code/modules/admin/secrets/fun_secrets/break_some_lights.dm b/code/modules/admin/secrets/fun_secrets/break_some_lights.dm
index f3784b1c16d2..bfa45de4cb5d 100644
--- a/code/modules/admin/secrets/fun_secrets/break_some_lights.dm
+++ b/code/modules/admin/secrets/fun_secrets/break_some_lights.dm
@@ -23,6 +23,6 @@
return
for(var/obj/abstract/landmark/epicentre in epicentreList)
- for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
+ for(var/obj/machinery/apc/apc in range(epicentre,lightsoutRange))
apc.overload_lighting()
CHECK_TICK
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index c22ef2c4ab04..8ff55c421dea 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -17,7 +17,7 @@
t += "Temperature: [env.temperature]\n"
t += "Pressure: [env.return_pressure()]kPa\n"
for(var/g in env.gas)
- t += "[g]: [env.gas[g]] / [env.gas[g] * R_IDEAL_GAS_EQUATION * env.temperature / env.volume]kPa\n"
+ t += "[g]: [env.gas[g]] / [env.gas[g] * R_IDEAL_GAS_EQUATION * env.temperature / env.total_volume]kPa\n"
usr.show_message(t, 1)
SSstatistics.add_field_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -188,7 +188,7 @@
if(!(A.type in areas_all))
areas_all.Add(A.type)
- for(var/obj/machinery/power/apc/APC in SSmachines.machinery)
+ for(var/obj/machinery/apc/APC in SSmachines.machinery)
var/area/A = get_area(APC)
if(!(A.type in areas_with_APC))
areas_with_APC.Add(A.type)
@@ -425,10 +425,9 @@
set name = "Spawn Material Stack"
if(!check_rights(R_DEBUG)) return
- var/decl/material/material = input("Select material to spawn") as null|anything in decls_repository.get_decls_of_subtype_unassociated(/decl/material)
- if(!istype(material))
- return
- material.create_object(get_turf(mob), 50)
+ var/decl/material/spawn_material = input("Select material to spawn") as null|anything in decls_repository.get_decls_of_subtype_unassociated(/decl/material)
+ if(istype(spawn_material))
+ spawn_material.create_object(get_turf(mob), 50)
/client/proc/force_ghost_trap_trigger()
set category = "Debug"
diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm
index 6d5b6f65e481..d588df659e21 100644
--- a/code/modules/admin/verbs/map_template_loadverb.dm
+++ b/code/modules/admin/verbs/map_template_loadverb.dm
@@ -5,7 +5,7 @@
if (!check_rights(R_FUN)) return
- var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in SSmapping.map_templates
+ var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in SSmapping.spawnable_map_templates
if(!map)
return
@@ -37,7 +37,7 @@
to_chat(usr, "Please wait for the master controller to initialize before loading maps!")
return
- var/map = input(usr, "Choose a Map Template to place on a new zlevel","Place Map Template") as null|anything in SSmapping.map_templates
+ var/map = input(usr, "Choose a Map Template to place on a new zlevel","Place Map Template") as null|anything in SSmapping.spawnable_map_templates
if(!map)
return
diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm
index f692cd70b9d7..7f8b14ca0064 100644
--- a/code/modules/assembly/igniter.dm
+++ b/code/modules/assembly/igniter.dm
@@ -23,7 +23,7 @@
if(location)
location.hotspot_expose(1000,1000)
if (istype(src.loc,/obj/item/assembly_holder))
- if (istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank/))
+ if (istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank))
var/obj/structure/reagent_dispensers/fueltank/tank = src.loc.loc
if(tank)
tank.try_detonate_reagents()
diff --git a/code/modules/atmospherics/atmos_primitives.dm b/code/modules/atmospherics/atmos_primitives.dm
index 4d78c3a4553a..6a09490b3251 100644
--- a/code/modules/atmospherics/atmos_primitives.dm
+++ b/code/modules/atmospherics/atmos_primitives.dm
@@ -45,7 +45,7 @@
//Update flow rate meter
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
- A.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ A.last_flow_rate = (transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
if (A.debug)
A.visible_message("[A]: source entropy: [round(source.specific_entropy(), 0.01)] J/Kmol --> sink entropy: [round(sink.specific_entropy(), 0.01)] J/Kmol")
@@ -55,7 +55,7 @@
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
- P.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ P.last_flow_rate = (transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
var/datum/gas_mixture/removed = source.remove(transfer_moles)
if (!removed) //Just in case
@@ -86,13 +86,13 @@
//Update flow rate meter
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
- A.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ A.last_flow_rate = (transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
if (A.debug)
A.visible_message("[A]: moles transferred = [transfer_moles] mol")
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
- P.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ P.last_flow_rate = (transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
var/datum/gas_mixture/removed = source.remove(transfer_moles)
if(!removed) //Just in case
@@ -148,10 +148,10 @@
//Update flow rate var
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
- A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
- P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
var/power_draw = 0
for (var/g in filtering)
@@ -217,10 +217,10 @@
//Update flow rate var
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
- A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
- P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
if (!removed) //Just in case
@@ -290,10 +290,10 @@
//Update Flow Rate var
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
- A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ A.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
- P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
+ P.last_flow_rate = (total_transfer_moles/source.total_moles)*source.total_volume //group_multiplier gets divided out here
var/datum/gas_mixture/removed = source.remove(total_transfer_moles)
if (!removed) //Just in case
@@ -350,7 +350,7 @@
source_specific_power[source] = calculate_specific_power(source, sink)*mix_ratio/ATMOS_FILTER_EFFICIENCY
total_specific_power += source_specific_power[source]
- total_input_volume += source.volume
+ total_input_volume += source.total_volume
total_input_moles += source.total_moles
if (total_mixing_moles < MINIMUM_MOLES_TO_FILTER) //if we cant transfer enough gas just stop to avoid further processing
@@ -429,7 +429,7 @@
/proc/calculate_transfer_moles(datum/gas_mixture/source, datum/gas_mixture/sink, var/pressure_delta, var/sink_volume_mod=0)
if(source.temperature == 0 || source.total_moles == 0) return 0
- var/output_volume = (sink.volume * sink.group_multiplier) + sink_volume_mod
+ var/output_volume = (sink.total_volume * sink.group_multiplier) + sink_volume_mod
var/source_total_moles = source.total_moles * source.group_multiplier
var/air_temperature = source.temperature
@@ -448,8 +448,8 @@
if(source.temperature == 0) return 0
//Make the approximation that the sink temperature is unchanged after transferring gas
- var/source_volume = source.volume * source.group_multiplier
- var/sink_volume = sink.volume * sink.group_multiplier
+ var/source_volume = source.total_volume * source.group_multiplier
+ var/sink_volume = sink.total_volume * sink.group_multiplier
var/source_pressure = source.return_pressure()
var/sink_pressure = sink.return_pressure()
diff --git a/code/modules/atmospherics/components/binary_devices/binary_atmos_base.dm b/code/modules/atmospherics/components/binary_devices/binary_atmos_base.dm
index bd58d0d112f0..70ccb935f755 100644
--- a/code/modules/atmospherics/components/binary_devices/binary_atmos_base.dm
+++ b/code/modules/atmospherics/components/binary_devices/binary_atmos_base.dm
@@ -12,8 +12,8 @@
air1 = new
air2 = new
- air1.volume = 200
- air2.volume = 200
+ air1.total_volume = 200
+ air2.total_volume = 200
. = ..()
/obj/machinery/atmospherics/binary/air_in_dir(direction)
diff --git a/code/modules/atmospherics/components/binary_devices/circulator.dm b/code/modules/atmospherics/components/binary_devices/circulator.dm
index 16f42c276e6f..723d76e56c0d 100644
--- a/code/modules/atmospherics/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/components/binary_devices/circulator.dm
@@ -31,7 +31,7 @@
/obj/machinery/atmospherics/binary/circulator/Initialize()
. = ..()
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
- air1.volume = 400
+ air1.total_volume = 400
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
var/datum/gas_mixture/removed
@@ -45,11 +45,11 @@
if(air1.temperature > 0 && last_pressure_delta > 5)
//Calculate necessary moles to transfer using PV = nRT
- recent_moles_transferred = (last_pressure_delta*input.volume/(air1.temperature * R_IDEAL_GAS_EQUATION))/3 //uses the volume of the whole network, not just itself
- volume_capacity_used = min( (last_pressure_delta*input.volume/3)/(input_starting_pressure*air1.volume) , 1) //how much of the gas in the input air volume is consumed
+ recent_moles_transferred = (last_pressure_delta*input.total_volume/(air1.temperature * R_IDEAL_GAS_EQUATION))/3 //uses the volume of the whole network, not just itself
+ volume_capacity_used = min( (last_pressure_delta*input.total_volume/3)/(input_starting_pressure*air1.total_volume) , 1) //how much of the gas in the input air volume is consumed
//Calculate energy generated from kinetic turbine
- stored_energy += 1/ADIABATIC_EXPONENT * min(last_pressure_delta * input.volume , input_starting_pressure*air1.volume) * (1 - volume_ratio**ADIABATIC_EXPONENT) * kinetic_efficiency
+ stored_energy += 1/ADIABATIC_EXPONENT * min(last_pressure_delta * input.total_volume , input_starting_pressure*air1.total_volume) * (1 - volume_ratio**ADIABATIC_EXPONENT) * kinetic_efficiency
//Actually transfer the gas
removed = air1.remove(recent_moles_transferred)
diff --git a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
index d38b7277bb12..7061e5bab0e6 100644
--- a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
+++ b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
@@ -90,7 +90,7 @@
var/pressure_delta = target_pressure - air2.return_pressure()
if (pressure_delta > 0.01 && inner_tank.temperature > 0)
var/datum/pipe_network/output = network_in_dir(dir)
- var/transfer_moles = calculate_transfer_moles(inner_tank, air2, pressure_delta, output?.volume)
+ var/transfer_moles = calculate_transfer_moles(inner_tank, air2, pressure_delta, output?.total_volume)
power_draw = pump_gas(src, inner_tank, air2, transfer_moles, power_rating*power_setting)
if (power_draw >= 0)
last_power_draw = power_draw
diff --git a/code/modules/atmospherics/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
index caacc188ddab..e34784fb7ee1 100644
--- a/code/modules/atmospherics/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
@@ -52,8 +52,8 @@
/obj/machinery/atmospherics/binary/passive_gate/Initialize()
. = ..()
- air1.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
- air2.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
+ air1.total_volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
+ air2.total_volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
/obj/machinery/atmospherics/binary/passive_gate/on_update_icon()
icon_state = (unlocked && flowing)? "on" : "off"
@@ -87,7 +87,7 @@
flowing = 1
//flow rate limit
- var/transfer_moles = (set_flow_rate/air1.volume)*air1.total_moles
+ var/transfer_moles = (set_flow_rate/air1.total_volume)*air1.total_moles
//Figure out how much gas to transfer to meet the target pressure.
switch (regulate_mode)
@@ -95,7 +95,7 @@
transfer_moles = min(transfer_moles, air1.total_moles*(pressure_delta/input_starting_pressure))
if (REGULATE_OUTPUT)
var/datum/pipe_network/output = network_in_dir(dir)
- transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, output?.volume))
+ transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, output?.total_volume))
//pump_gas() will return a negative number if no flow occurred
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
@@ -174,11 +174,11 @@
set_flow_rate = 0
. = TOPIC_REFRESH
if ("max")
- set_flow_rate = air1.volume
+ set_flow_rate = air1.total_volume
. = TOPIC_REFRESH
if ("set")
- var/new_flow_rate = input(user, "Enter new flow rate limit (0-[air1.volume]kPa)","Flow Rate Control",set_flow_rate) as num
- set_flow_rate = clamp(new_flow_rate, 0, air1.volume)
+ var/new_flow_rate = input(user, "Enter new flow rate limit (0-[air1.total_volume]kPa)","Flow Rate Control",set_flow_rate) as num
+ set_flow_rate = clamp(new_flow_rate, 0, air1.total_volume)
. = TOPIC_REFRESH
/obj/machinery/atmospherics/binary/passive_gate/proc/toggle_unlocked()
@@ -219,7 +219,7 @@
return machine.set_flow_rate
/decl/public_access/public_variable/passive_gate_flow_rate/write_var(obj/machinery/atmospherics/binary/passive_gate/machine, new_value)
- new_value = clamp(new_value, 0, machine.air1?.volume)
+ new_value = clamp(new_value, 0, machine.air1?.total_volume)
. = ..()
if(.)
machine.set_flow_rate = new_value
diff --git a/code/modules/atmospherics/components/binary_devices/pipeturbine.dm b/code/modules/atmospherics/components/binary_devices/pipeturbine.dm
index 510fe486f1e5..3891c252af87 100644
--- a/code/modules/atmospherics/components/binary_devices/pipeturbine.dm
+++ b/code/modules/atmospherics/components/binary_devices/pipeturbine.dm
@@ -21,9 +21,9 @@
/obj/machinery/atmospherics/pipeturbine/Initialize()
. = ..()
- air_in.volume = 200
- air_out.volume = 800
- volume_ratio = air_in.volume / (air_in.volume + air_out.volume)
+ air_in.total_volume = 200
+ air_out.total_volume = 800
+ volume_ratio = air_in.total_volume / (air_in.total_volume + air_out.total_volume)
/obj/machinery/atmospherics/pipeturbine/get_initialize_directions()
switch(dir)
@@ -48,11 +48,11 @@
kin_energy *= 1 - kin_loss
dP = max(air_in.return_pressure() - air_out.return_pressure(), 0)
if(dP > 10)
- kin_energy += 1/ADIABATIC_EXPONENT * dP * air_in.volume * (1 - volume_ratio**ADIABATIC_EXPONENT) * efficiency
+ kin_energy += 1/ADIABATIC_EXPONENT * dP * air_in.total_volume * (1 - volume_ratio**ADIABATIC_EXPONENT) * efficiency
air_in.temperature *= volume_ratio**ADIABATIC_EXPONENT
var/datum/gas_mixture/air_all = new
- air_all.volume = air_in.volume + air_out.volume
+ air_all.total_volume = air_in.total_volume + air_out.total_volume
air_all.merge(air_in.remove_ratio(1))
air_all.merge(air_out.remove_ratio(1))
diff --git a/code/modules/atmospherics/components/binary_devices/pump.dm b/code/modules/atmospherics/components/binary_devices/pump.dm
index eeb70c699672..27fe8910c85f 100644
--- a/code/modules/atmospherics/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/components/binary_devices/pump.dm
@@ -5,9 +5,9 @@ node1, air1, network1 correspond to input
node2, air2, network2 correspond to output
Thus, the two variables affect pump operation are set in New():
- air1.volume
+ air1.total_volume
This is the volume of gas available to the pump that may be transfered to the output
- air2.volume
+ air2.total_volume
Higher quantities of this cause more air to be perfected later
but overall network volume is also increased as this increases...
*/
@@ -61,8 +61,8 @@ Thus, the two variables affect pump operation are set in New():
/obj/machinery/atmospherics/binary/pump/Initialize()
. = ..()
- air1.volume = ATMOS_DEFAULT_VOLUME_PUMP
- air2.volume = ATMOS_DEFAULT_VOLUME_PUMP
+ air1.total_volume = ATMOS_DEFAULT_VOLUME_PUMP
+ air2.total_volume = ATMOS_DEFAULT_VOLUME_PUMP
/obj/machinery/atmospherics/binary/pump/on
icon_state = "map_on"
@@ -93,7 +93,7 @@ Thus, the two variables affect pump operation are set in New():
if(pressure_delta > 0.01 && air1.temperature > 0)
//Figure out how much gas to transfer to meet the target pressure.
var/datum/pipe_network/output = network_in_dir(dir)
- var/transfer_moles = calculate_transfer_moles(air1, air2, pressure_delta, output?.volume)
+ var/transfer_moles = calculate_transfer_moles(air1, air2, pressure_delta, output?.total_volume)
power_draw = pump_gas(src, air1, air2, transfer_moles, power_rating)
if(transfer_moles > 0)
diff --git a/code/modules/atmospherics/components/omni_devices/_omni_extras.dm b/code/modules/atmospherics/components/omni_devices/_omni_extras.dm
index 1135f240029f..9aeb0d2eb576 100644
--- a/code/modules/atmospherics/components/omni_devices/_omni_extras.dm
+++ b/code/modules/atmospherics/components/omni_devices/_omni_extras.dm
@@ -30,7 +30,7 @@
if(istype(M))
master = M
air = new
- air.volume = 200
+ air.total_volume = 200
/datum/omni_port/Destroy()
QDEL_NULL(network)
diff --git a/code/modules/atmospherics/components/omni_devices/filter.dm b/code/modules/atmospherics/components/omni_devices/filter.dm
index 1c140c763a77..64d99bb5140c 100644
--- a/code/modules/atmospherics/components/omni_devices/filter.dm
+++ b/code/modules/atmospherics/components/omni_devices/filter.dm
@@ -39,7 +39,7 @@
rebuild_filtering_list()
for(var/datum/omni_port/P in ports)
- P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER
+ P.air.total_volume = ATMOS_DEFAULT_VOLUME_FILTER
/obj/machinery/atmospherics/omni/filter/Destroy()
input = null
@@ -57,7 +57,7 @@
if(P in gas_filters)
gas_filters -= P
- P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER
+ P.air.total_volume = ATMOS_DEFAULT_VOLUME_FILTER
switch(P.mode)
if(ATM_INPUT)
input = P
@@ -82,13 +82,13 @@
var/datum/gas_mixture/input_air = input.air // it's completely happy with them if they're in a loop though i.e. "P.air.return_pressure()"... *shrug*
var/delta = clamp(0, (output_air ? (max_output_pressure - output_air.return_pressure()) : 0), max_output_pressure)
- var/transfer_moles_max = calculate_transfer_moles(input_air, output_air, delta, (output && output.network && output.network.volume) ? output.network.volume : 0)
+ var/transfer_moles_max = calculate_transfer_moles(input_air, output_air, delta, (output && output.network && output.network.total_volume) ? output.network.total_volume : 0)
for(var/datum/omni_port/filter_output in gas_filters)
delta = clamp(0, (filter_output.air ? (max_output_pressure - filter_output.air.return_pressure()) : 0), max_output_pressure)
- transfer_moles_max = min(transfer_moles_max, (calculate_transfer_moles(input_air, filter_output.air, delta, (filter_output && filter_output.network && filter_output.network.volume) ? filter_output.network.volume : 0)))
+ transfer_moles_max = min(transfer_moles_max, (calculate_transfer_moles(input_air, filter_output.air, delta, (filter_output && filter_output.network && filter_output.network.total_volume) ? filter_output.network.total_volume : 0)))
//Figure out the amount of moles to transfer
- var/transfer_moles = clamp(0, ((set_flow_rate/input_air.volume)*input_air.total_moles), transfer_moles_max)
+ var/transfer_moles = clamp(0, ((set_flow_rate/input_air.total_volume)*input_air.total_moles), transfer_moles_max)
var/power_draw = -1
if (transfer_moles > MINIMUM_MOLES_TO_FILTER)
diff --git a/code/modules/atmospherics/components/omni_devices/mixer.dm b/code/modules/atmospherics/components/omni_devices/mixer.dm
index 483e114a9f60..bff092218863 100644
--- a/code/modules/atmospherics/components/omni_devices/mixer.dm
+++ b/code/modules/atmospherics/components/omni_devices/mixer.dm
@@ -54,7 +54,7 @@
con += max(0, tag_west_con)
for(var/datum/omni_port/P in ports)
- P.air.volume = ATMOS_DEFAULT_VOLUME_MIXER
+ P.air.total_volume = ATMOS_DEFAULT_VOLUME_MIXER
/obj/machinery/atmospherics/omni/mixer/Destroy()
inputs.Cut()
@@ -80,7 +80,7 @@
P.concentration = 1 / max(1, inputs.len)
if(output)
- output.air.volume = ATMOS_DEFAULT_VOLUME_MIXER * 0.75 * inputs.len
+ output.air.total_volume = ATMOS_DEFAULT_VOLUME_MIXER * 0.75 * inputs.len
output.concentration = 1
rebuild_mixing_inputs()
@@ -117,8 +117,8 @@
for (var/datum/omni_port/P in inputs)
if(!P.concentration)
continue
- transfer_moles += (set_flow_rate*P.concentration/P.air.volume)*P.air.total_moles
- transfer_moles_max = min(transfer_moles_max, calculate_transfer_moles(P.air, output.air, delta, (output && output.network && output.network.volume) ? output.network.volume : 0))
+ transfer_moles += (set_flow_rate*P.concentration/P.air.total_volume)*P.air.total_moles
+ transfer_moles_max = min(transfer_moles_max, calculate_transfer_moles(P.air, output.air, delta, (output && output.network && output.network.total_volume) ? output.network.total_volume : 0))
transfer_moles = clamp(0, transfer_moles, transfer_moles_max)
var/power_draw = -1
diff --git a/code/modules/atmospherics/components/trinary_devices/trinary_base.dm b/code/modules/atmospherics/components/trinary_devices/trinary_base.dm
index 38a0a30f0116..ba82faaf6d1e 100644
--- a/code/modules/atmospherics/components/trinary_devices/trinary_base.dm
+++ b/code/modules/atmospherics/components/trinary_devices/trinary_base.dm
@@ -15,9 +15,9 @@
air2 = new
air3 = new
- air1.volume = 200
- air2.volume = 200
- air3.volume = 200
+ air1.total_volume = 200
+ air2.total_volume = 200
+ air3.total_volume = 200
. = ..()
/obj/machinery/atmospherics/trinary/air_in_dir(direction)
diff --git a/code/modules/atmospherics/components/unary/cold_sink.dm b/code/modules/atmospherics/components/unary/cold_sink.dm
index f65afc65962f..18ab66f03864 100644
--- a/code/modules/atmospherics/components/unary/cold_sink.dm
+++ b/code/modules/atmospherics/components/unary/cold_sink.dm
@@ -123,7 +123,7 @@
power_rating = initial(power_rating) * cap_rating / 2 //more powerful
heatsink_temperature = initial(heatsink_temperature) / ((manip_rating + bin_rating) / 2) //more efficient
- air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
+ air_contents.total_volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
set_power_level(power_setting)
/obj/machinery/atmospherics/unary/freezer/proc/set_power_level(var/new_power_setting)
diff --git a/code/modules/atmospherics/components/unary/heat_source.dm b/code/modules/atmospherics/components/unary/heat_source.dm
index cb7df0f6098a..435bf70e9f1e 100644
--- a/code/modules/atmospherics/components/unary/heat_source.dm
+++ b/code/modules/atmospherics/components/unary/heat_source.dm
@@ -110,7 +110,7 @@
max_power_rating = initial(max_power_rating) * cap_rating / 2
max_temperature = max(initial(max_temperature) - T20C, 0) * ((bin_rating * 4 + cap_rating) / 5) + T20C
- air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
+ air_contents.total_volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating
set_power_level(power_setting)
/obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting)
diff --git a/code/modules/atmospherics/components/unary/outlet_injector.dm b/code/modules/atmospherics/components/unary/outlet_injector.dm
index 1ed273483573..8f3d287c78c1 100644
--- a/code/modules/atmospherics/components/unary/outlet_injector.dm
+++ b/code/modules/atmospherics/components/unary/outlet_injector.dm
@@ -56,7 +56,7 @@
/obj/machinery/atmospherics/unary/outlet_injector/Initialize()
. = ..()
//Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more.
- air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500
+ air_contents.total_volume = ATMOS_DEFAULT_VOLUME_PUMP + 500
/obj/machinery/atmospherics/unary/outlet_injector/on_update_icon()
if(stat & NOPOWER)
@@ -94,7 +94,7 @@
var/datum/gas_mixture/environment = loc.return_air()
if(environment && air_contents.temperature > 0)
- var/transfer_moles = (volume_rate/air_contents.volume)*air_contents.total_moles //apply flow rate limit
+ var/transfer_moles = (volume_rate/air_contents.total_volume)*air_contents.total_moles //apply flow rate limit
power_draw = pump_gas(src, air_contents, environment, transfer_moles, power_rating)
if(transfer_moles > 0)
update_networks()
@@ -147,7 +147,7 @@
return machine.volume_rate
/decl/public_access/public_variable/volume_rate/write_var(obj/machinery/atmospherics/unary/outlet_injector/machine, new_value)
- new_value = clamp(new_value, 0, machine.air_contents.volume)
+ new_value = clamp(new_value, 0, machine.air_contents.total_volume)
. = ..()
if(.)
machine.volume_rate = new_value
diff --git a/code/modules/atmospherics/components/unary/tank.dm b/code/modules/atmospherics/components/unary/tank.dm
index 52c6c6fc0278..96bb673ca228 100644
--- a/code/modules/atmospherics/components/unary/tank.dm
+++ b/code/modules/atmospherics/components/unary/tank.dm
@@ -5,7 +5,7 @@
name = "Pressure Tank"
desc = "A large vessel containing pressurized gas."
- var/volume = 10000 //in liters, 1 meters by 1 meters by 2 meters ~tweaked it a little to simulate a pressure tank without needing to recode them yet
+ var/gas_volume = 10000 //in liters, 1 meters by 1 meters by 2 meters ~tweaked it a little to simulate a pressure tank without needing to recode them yet
var/start_pressure = 25 ATM
var/filling // list of gas ratios to use.
@@ -25,12 +25,12 @@
/obj/machinery/atmospherics/unary/tank/Initialize()
. = ..()
- air_contents.volume = volume
+ air_contents.total_volume = gas_volume
air_contents.temperature = T20C
if(filling)
for(var/gas in filling)
- air_contents.adjust_gas(gas, start_pressure * filling[gas] * (air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature), FALSE)
+ air_contents.adjust_gas(gas, start_pressure * filling[gas] * (air_contents.total_volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature), FALSE)
air_contents.update_values()
update_icon()
diff --git a/code/modules/atmospherics/components/unary/unary_base.dm b/code/modules/atmospherics/components/unary/unary_base.dm
index 290cd80db5be..6cbe3cb184b6 100644
--- a/code/modules/atmospherics/components/unary/unary_base.dm
+++ b/code/modules/atmospherics/components/unary/unary_base.dm
@@ -19,7 +19,7 @@
/obj/machinery/atmospherics/unary/Initialize()
air_contents = new
- air_contents.volume = 200
+ air_contents.total_volume = 200
if(controlled)
reset_area(null, get_area(src))
. = ..()
@@ -34,7 +34,7 @@
/obj/machinery/atmospherics/unary/physically_destroyed()
if(loc && air_contents)
loc.assume_air(air_contents)
- . = ..()
+ . = ..()
/obj/machinery/atmospherics/unary/dismantle()
if(loc && air_contents)
diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm
index c463a0687ce1..49fcbbbb2765 100644
--- a/code/modules/atmospherics/components/unary/vent_pump.dm
+++ b/code/modules/atmospherics/components/unary/vent_pump.dm
@@ -85,7 +85,7 @@
update_name()
events_repository.register(/decl/observ/name_set, A, src, PROC_REF(change_area_name))
. = ..()
- air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP
+ air_contents.total_volume = ATMOS_DEFAULT_VOLUME_PUMP
update_sound()
/obj/machinery/atmospherics/unary/vent_pump/proc/change_area_name(var/area/A, var/old_area_name, var/new_area_name)
@@ -170,7 +170,7 @@
/obj/machinery/atmospherics/unary/vent_pump/high_volume/Initialize()
. = ..()
- air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
+ air_contents.total_volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
/obj/machinery/atmospherics/unary/vent_pump/on_update_icon()
var/visible_directions = build_device_underlays()
@@ -223,7 +223,7 @@
power_draw = pump_gas(src, air_contents, environment, transfer_moles, power_rating)
else //external -> internal
var/datum/pipe_network/network = network_in_dir(dir)
- transfer_moles = calculate_transfer_moles(environment, air_contents, pressure_delta, network?.volume) / environment.group_multiplier // limit it to just one turf's worth of gas per tick
+ transfer_moles = calculate_transfer_moles(environment, air_contents, pressure_delta, network?.total_volume) / environment.group_multiplier // limit it to just one turf's worth of gas per tick
power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating)
else
@@ -562,7 +562,7 @@
/obj/machinery/atmospherics/unary/vent_pump/engine/Initialize()
. = ..()
- air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //meant to match air injector
+ air_contents.total_volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //meant to match air injector
/obj/machinery/atmospherics/unary/vent_pump/power_change()
. = ..()
diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm
index 9ab3bc3e4976..2a2aac82fd5e 100644
--- a/code/modules/atmospherics/components/unary/vent_scrubber.dm
+++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm
@@ -68,7 +68,7 @@
if(g != /decl/material/gas/oxygen && g != /decl/material/gas/nitrogen)
scrubbing_gas += g
. = ..()
- air_contents.volume = ATMOS_DEFAULT_VOLUME_FILTER
+ air_contents.total_volume = ATMOS_DEFAULT_VOLUME_FILTER
/obj/machinery/atmospherics/unary/vent_scrubber/reset_area(area/old_area, area/new_area)
if(!controlled)
@@ -151,17 +151,17 @@
var/transfer_moles = 0
if(scrubbing == SCRUBBER_SIPHON) //Just siphon all air
//limit flow rate from turfs
- transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
+ transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.total_volume) //group_multiplier gets divided out here
power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating)
else //limit flow rate from turfs
- transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.volume) //group_multiplier gets divided out here
+ transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.total_volume) //group_multiplier gets divided out here
power_draw = scrub_gas(src, scrubbing_gas, environment, air_contents, transfer_moles, power_rating)
if(scrubbing != SCRUBBER_SIPHON && power_draw <= 0) //99% of all scrubbers
//Fucking hibernate because you ain't doing shit.
hibernate = world.time + (rand(100,200))
else if(scrubbing == SCRUBBER_EXCHANGE) // after sleep check so it only does an exchange if there are bad gasses that have been scrubbed
- transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.volume)
+ transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.total_volume)
power_draw += pump_gas(src, environment, air_contents, transfer_moles / 4, power_rating)
if (power_draw >= 0)
diff --git a/code/modules/atmospherics/datum_pipe_network.dm b/code/modules/atmospherics/datum_pipe_network.dm
index 37d8d1be7687..edfe6c240328 100644
--- a/code/modules/atmospherics/datum_pipe_network.dm
+++ b/code/modules/atmospherics/datum_pipe_network.dm
@@ -1,6 +1,6 @@
/datum/pipe_network
var/list/datum/gas_mixture/gases = list() //All of the gas_mixtures continuously connected in this network
- var/volume = 0 //caches the total volume for atmos machines to use in gas calculations
+ var/total_volume = 0 //caches the total volume for atmos machines to use in gas calculations
var/list/obj/machinery/atmospherics/normal_members = list()
var/list/datum/pipeline/line_members = list()
@@ -71,7 +71,7 @@
//Go through membership roster and make sure gases is up to date
gases = list()
- volume = 0
+ total_volume = 0
for(var/obj/machinery/atmospherics/normal_member in normal_members)
var/result = normal_member.return_network_air(src)
@@ -81,4 +81,4 @@
gases += line_member.air
for(var/datum/gas_mixture/air in gases)
- volume += air.volume
+ total_volume += air.total_volume
diff --git a/code/modules/atmospherics/datum_pipeline.dm b/code/modules/atmospherics/datum_pipeline.dm
index 7ece1fe43700..89e598b527ff 100644
--- a/code/modules/atmospherics/datum_pipeline.dm
+++ b/code/modules/atmospherics/datum_pipeline.dm
@@ -30,7 +30,7 @@
STOP_PROCESSING(SSprocessing, src)
QDEL_NULL(network)
- if(air?.volume || liquid?.total_volume)
+ if(air?.total_volume || liquid?.total_volume)
temporarily_store_fluids()
QDEL_NULL(air)
@@ -62,15 +62,15 @@
//Update individual gas_mixtures by volume ratio
var/liquid_transfer_per_pipe = min(REAGENT_UNITS_PER_PIPE, (liquid && length(members)) ? (liquid.total_volume / length(members)) : 0)
- if(!air?.volume && !liquid_transfer_per_pipe)
+ if(!air?.total_volume && !liquid_transfer_per_pipe)
return
for(var/obj/machinery/atmospherics/pipe/member in members)
- if(air?.volume)
+ if(air?.total_volume)
member.air_temporary = new
member.air_temporary.copy_from(air)
- member.air_temporary.volume = member.volume
- member.air_temporary.multiply(member.volume / air.volume)
+ member.air_temporary.total_volume = member.gas_volume
+ member.air_temporary.multiply(member.gas_volume / air.total_volume)
if(liquid_transfer_per_pipe)
member.liquid_temporary = new(REAGENT_UNITS_PER_PIPE, member)
@@ -81,7 +81,7 @@
members = list(base)
edges = list()
- var/volume = base.volume
+ var/temp_volume = base.gas_volume
base.parent = src
maximum_pressure = base.maximum_pressure
@@ -110,7 +110,7 @@
members += item
possible_expansions += item
- volume += item.volume
+ temp_volume += item.gas_volume
item.parent = src
maximum_pressure = min(maximum_pressure, item.maximum_pressure)
@@ -134,7 +134,7 @@
possible_expansions -= borderline
- air.volume = volume
+ air.total_volume = temp_volume
liquid.maximum_volume = length(members) * REAGENT_UNITS_PER_PIPE
/datum/pipeline/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
@@ -194,11 +194,11 @@
/datum/pipeline/proc/temperature_interact(turf/target, share_volume, thermal_conductivity)
- if(air.volume <= 0) // Avoid div by zero.
+ if(air.total_volume <= 0) // Avoid div by zero.
return
var/total_heat_capacity = air.heat_capacity()
- var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume)
+ var/partial_heat_capacity = total_heat_capacity*(share_volume/air.total_volume)
var/datum/gas_mixture/target_air = target.return_air()
if(total_heat_capacity <= 0) // Avoid div by zero.
@@ -225,7 +225,7 @@
//surface must be the surface area in m^2
/datum/pipeline/proc/radiate_heat_to_space(surface, thermal_conductivity)
- var/gas_density = air.total_moles/air.volume
+ var/gas_density = air.total_moles/air.total_volume
thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*GAS_CRITICAL_TEMPERATURE) ), 1) //mult by density ratio
var/heat_gain = get_thermal_radiation(air.temperature, surface, RADIATOR_EXPOSED_SURFACE_AREA_RATIO, thermal_conductivity)
diff --git a/code/modules/atmospherics/he_pipes.dm b/code/modules/atmospherics/he_pipes.dm
index a82bfab40318..2a11c6cde77d 100644
--- a/code/modules/atmospherics/he_pipes.dm
+++ b/code/modules/atmospherics/he_pipes.dm
@@ -73,7 +73,7 @@
var/datum/gas_mixture/environment = turf.return_air()
environment_temperature = environment?.temperature || 0
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
- parent.temperature_interact(turf, volume, thermal_conductivity)
+ parent.temperature_interact(turf, gas_volume, thermal_conductivity)
// Burn mobs buckled to this pipe.
if(buckled_mob)
diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm
index f054a258a916..ef7fa5484345 100644
--- a/code/modules/atmospherics/pipes.dm
+++ b/code/modules/atmospherics/pipes.dm
@@ -24,7 +24,7 @@
var/datum/gas_mixture/air_temporary // used when reconstructing a pipeline that broke
var/datum/reagents/liquid_temporary // used when reconstructing a pipeline that broke
var/datum/pipeline/parent
- var/volume = 0
+ var/gas_volume = 0
var/leaking = 0 // Do not set directly, use set_leaking(TRUE/FALSE)
//minimum pressure before check_pressure(...) should be called
@@ -210,7 +210,7 @@
update_sound(0)
. = PROCESS_KILL
else if(leaking)
- parent.mingle_with_turf(loc, volume)
+ parent.mingle_with_turf(loc, gas_volume)
var/air = parent.air?.return_pressure()
if(!sound_token && air)
update_sound(1)
@@ -225,7 +225,7 @@
name = "pipe"
desc = "A one-meter section of regular pipe."
- volume = ATMOS_DEFAULT_VOLUME_PIPE
+ gas_volume = ATMOS_DEFAULT_VOLUME_PIPE
dir = SOUTH
initialize_directions = SOUTH|NORTH
@@ -380,7 +380,7 @@
icon_state = "map"
name = "pipe manifold"
desc = "A manifold composed of regular pipes."
- volume = ATMOS_DEFAULT_VOLUME_PIPE * 1.5
+ gas_volume = ATMOS_DEFAULT_VOLUME_PIPE * 1.5
dir = SOUTH
initialize_directions = EAST|NORTH|WEST
@@ -509,7 +509,7 @@
icon_state = ""
name = "4-way pipe manifold"
desc = "A manifold composed of regular pipes."
- volume = ATMOS_DEFAULT_VOLUME_PIPE * 2
+ gas_volume = ATMOS_DEFAULT_VOLUME_PIPE * 2
dir = SOUTH
initialize_directions = NORTH|SOUTH|EAST|WEST
@@ -634,7 +634,7 @@
icon = 'icons/atmos/pipes.dmi'
icon_state = "cap"
level = LEVEL_ABOVE_PLATING
- volume = 35
+ gas_volume = 35
pipe_class = PIPE_CLASS_UNARY
dir = SOUTH
diff --git a/code/modules/backgrounds/_background.dm b/code/modules/backgrounds/_background.dm
index c456c54b1167..288419678b85 100644
--- a/code/modules/backgrounds/_background.dm
+++ b/code/modules/backgrounds/_background.dm
@@ -46,7 +46,7 @@
secondary_langs -= additional_langs
UNSETEMPTY(secondary_langs)
-/decl/background_detail/proc/get_random_name(var/mob/M, var/gender)
+/decl/background_detail/proc/get_random_cultural_name(mob/recipient, gender, species)
var/decl/language/_language
if(name_language)
_language = GET_DECL(name_language)
@@ -55,7 +55,7 @@
else if(language)
_language = GET_DECL(language)
if(_language)
- return _language.get_random_name(gender)
+ return _language.get_random_language_name(gender)
return capitalize(pick(gender==FEMALE ? global.using_map.first_names_female : global.using_map.first_names_male)) + " " + capitalize(pick(global.using_map.last_names))
/decl/background_detail/proc/sanitize_background_name(new_name)
diff --git a/code/modules/backgrounds/heritage/heritage_hidden.dm b/code/modules/backgrounds/heritage/heritage_hidden.dm
index 05babf45c618..cdd979437ff4 100644
--- a/code/modules/backgrounds/heritage/heritage_hidden.dm
+++ b/code/modules/backgrounds/heritage/heritage_hidden.dm
@@ -15,7 +15,7 @@
language = /decl/language/cultcommon
uid = "heritage_bloodcult"
-/decl/background_detail/heritage/hidden/cultist/get_random_name()
+/decl/background_detail/heritage/hidden/cultist/get_random_cultural_name(mob/recipient, gender, species)
return "[pick("Anguished", "Blasphemous", "Corrupt", "Cruel", "Depraved", "Despicable", "Disturbed", "Exacerbated", "Foul", "Hateful", "Inexorable", "Implacable", "Impure", "Malevolent", "Malignant", "Malicious", "Pained", "Profane", "Profligate", "Relentless", "Resentful", "Restless", "Spiteful", "Tormented", "Unclean", "Unforgiving", "Vengeful", "Vindictive", "Wicked", "Wronged")] [pick("Apparition", "Aptrgangr", "Dis", "Draugr", "Dybbuk", "Eidolon", "Fetch", "Fylgja", "Ghast", "Ghost", "Gjenganger", "Haint", "Phantom", "Phantasm", "Poltergeist", "Revenant", "Shade", "Shadow", "Soul", "Spectre", "Spirit", "Spook", "Visitant", "Wraith")]"
/decl/background_detail/heritage/hidden/monkey
diff --git a/code/modules/barricade_tape/barricade_tape.dm b/code/modules/barricade_tape/barricade_tape.dm
index b0f81d840a3f..689039b34c09 100644
--- a/code/modules/barricade_tape/barricade_tape.dm
+++ b/code/modules/barricade_tape/barricade_tape.dm
@@ -25,7 +25,7 @@ var/global/list/image/hazard_overlays //Cached hazard floor overlays for the bar
pass_flags = PASS_FLAG_TABLE //About the height of table
anchored = TRUE
material = /decl/material/solid/organic/plastic
- current_health = 5
+ max_health = 5
var/neighbors = 0 //Contains all the direction flags of all the neighboring tape_barricades
var/is_lifted = 0 //Whether the tape is lifted and we're allowing everyone passage.
var/is_crumpled = 0 //Whether the tape was damaged
diff --git a/code/modules/butchery/butchery_products.dm b/code/modules/butchery/butchery_products.dm
index 659416ea06c3..268f02b43d93 100644
--- a/code/modules/butchery/butchery_products.dm
+++ b/code/modules/butchery/butchery_products.dm
@@ -5,7 +5,7 @@
material = /decl/material/solid/organic/meat
color = /decl/material/solid/organic/meat::color
w_class = ITEM_SIZE_NORMAL
- volume = 20
+ chem_volume = 20
nutriment_type = /decl/material/solid/organic/meat
nutriment_desc = list("umami" = 10)
nutriment_amt = 20
diff --git a/code/modules/client/preference_setup/background/02_background.dm b/code/modules/client/preference_setup/background/02_background.dm
index 6ce982e37d81..616c574f631d 100644
--- a/code/modules/client/preference_setup/background/02_background.dm
+++ b/code/modules/client/preference_setup/background/02_background.dm
@@ -67,7 +67,7 @@
if(istype(check))
pref.real_name = check.sanitize_background_name(pref.real_name, pref.species)
if(!pref.real_name)
- pref.real_name = check.get_random_name(get_mannequin(pref.client?.ckey), pref.gender)
+ pref.real_name = check.get_random_cultural_name(get_mannequin(pref.client?.ckey), pref.gender, pref.species)
// Load an associative list of background category type to a background type.
/datum/category_item/player_setup_item/background/details/load_character(datum/pref_record_reader/R)
diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm
index 83a11ec1a5d4..416c9d7e294a 100644
--- a/code/modules/client/preference_setup/general/01_basic.dm
+++ b/code/modules/client/preference_setup/general/01_basic.dm
@@ -76,7 +76,7 @@
if(pref.be_random_name)
var/decl/background_detail/background = pref.get_background_datum_by_flag(BACKGROUND_FLAG_NAMING)
if(background)
- new_real_name = background.get_random_name(pref.gender)
+ new_real_name = background.get_random_cultural_name(gender = pref.gender, species = pref.species)
if(get_config_value(/decl/config/toggle/humans_need_surnames))
var/firstspace = findtext(new_real_name, " ")
var/name_length = length(new_real_name)
diff --git a/code/modules/client/preference_setup/general/02_body.dm b/code/modules/client/preference_setup/general/02_body.dm
index fc96fa6b3d29..5f565bdaef41 100644
--- a/code/modules/client/preference_setup/general/02_body.dm
+++ b/code/modules/client/preference_setup/general/02_body.dm
@@ -196,9 +196,7 @@
for(var/metadata_type in acc_data)
var/decl/sprite_accessory_metadata/metadata = GET_DECL(metadata_type)
if(istype(metadata))
- var/value = acc_data[metadata_type]
- if(!metadata.validate_data(value))
- acc_data[metadata_type] = metadata.default_value
+ acc_data[metadata_type] = metadata.sanitize_data(acc_data[metadata_type])
else
acc_data -= metadata_type
diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm
index f893c8b49080..ceb5eaaeac52 100644
--- a/code/modules/client/preference_setup/loadout/loadout.dm
+++ b/code/modules/client/preference_setup/loadout/loadout.dm
@@ -491,10 +491,10 @@
var/location
var/material
-/datum/gear_data/New(var/path, var/location, var/material)
- src.path = path
- src.location = location
- src.material = material
+/datum/gear_data/New(var/_path, var/_location, var/_mat)
+ src.path = _path
+ src.location = _location
+ src.material = _mat
/datum/gear_data/proc/can_replace_existing(obj/item/candidate)
return istype(candidate, path)
diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm
index feb41bc98058..e8b60f09dab0 100644
--- a/code/modules/client/preference_setup/occupation/occupation.dm
+++ b/code/modules/client/preference_setup/occupation/occupation.dm
@@ -185,9 +185,6 @@
skill_link = "View Skills"
skill_link = "[skill_link] | "
- if(!user.skillset?.skills_transferable)
- skill_link = ""
-
// Begin assembling the actual HTML.
index += 1
if((index >= limit) || (job.title in splitJobs))
diff --git a/code/modules/clothing/gloves/jewelry/rings/ring_reagent.dm b/code/modules/clothing/gloves/jewelry/rings/ring_reagent.dm
index c19417797489..c38fdeaa1319 100644
--- a/code/modules/clothing/gloves/jewelry/rings/ring_reagent.dm
+++ b/code/modules/clothing/gloves/jewelry/rings/ring_reagent.dm
@@ -3,18 +3,7 @@
/obj/item/clothing/gloves/ring/reagent
atom_flags = ATOM_FLAG_OPEN_CONTAINER
origin_tech = @'{"materials":2,"esoteric":4}'
- var/tmp/volume = 15
-
-/obj/item/clothing/gloves/ring/reagent/Initialize(ml, material_key)
- . = ..()
- initialize_reagents()
-
-/obj/item/clothing/gloves/ring/reagent/initialize_reagents(populate = TRUE)
- if(!reagents)
- create_reagents(volume)
- else
- reagents.maximum_volume = max(volume, reagents.maximum_volume)
- . = ..()
+ chem_volume = 15
/obj/item/clothing/gloves/ring/reagent/equipped(var/mob/living/human/H)
..()
diff --git a/code/modules/clothing/masks/chewable.dm b/code/modules/clothing/masks/chewable.dm
index 1df74f5bc5fa..c6d6285826bc 100644
--- a/code/modules/clothing/masks/chewable.dm
+++ b/code/modules/clothing/masks/chewable.dm
@@ -8,17 +8,11 @@
matter = null // no plastic/fiberglass
var/type_butt = null
- var/chem_volume = 0
var/chewtime = 0
var/brand
/obj/item/clothing/mask/chewable/Initialize()
- . = ..()
atom_flags |= ATOM_FLAG_NO_CHEM_CHANGE // so it doesn't react until you light it
- initialize_reagents()
-
-/obj/item/clothing/mask/chewable/initialize_reagents(populate = TRUE)
- create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15
. = ..()
/obj/item/clothing/mask/chewable/equipped(var/mob/living/user, var/slot)
@@ -107,9 +101,9 @@
icon = 'icons/clothing/mask/chewables/gum_nicotine.dmi'
type_butt = /obj/item/trash/cigbutt/spitgum
-/obj/item/clothing/mask/chewable/tobacco/nico/initialize_reagents(populate = TRUE)
+/obj/item/clothing/mask/chewable/tobacco/nico/Initialize()
. = ..()
- color = reagents.get_color()
+ color = reagents?.get_color()
/obj/item/clothing/mask/chewable/tobacco/nico/populate_reagents()
add_to_reagents(/decl/material/liquid/nicotine, 2)
@@ -137,7 +131,7 @@
/obj/item/clothing/mask/chewable/candy/proc/get_possible_initial_reagents()
return
-/obj/item/clothing/mask/chewable/candy/initialize_reagents()
+/obj/item/clothing/mask/chewable/candy/Initialize()
. = ..()
if(reagents?.total_volume)
set_color(reagents.get_color())
diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm
index 05ee28f68f4a..26982600a61e 100644
--- a/code/modules/clothing/masks/miscellaneous.dm
+++ b/code/modules/clothing/masks/miscellaneous.dm
@@ -157,7 +157,7 @@
if(istype(S))
var/decl/background_detail/C = GET_DECL(S.default_background_info[/decl/background_category/heritage])
if(istype(C))
- visible_name = C.get_random_name(pick(MALE,FEMALE))
+ visible_name = C.get_random_cultural_name(gender = pick(MALE,FEMALE), species = species)
/obj/item/clothing/mask/rubber/species/cat
name = "cat mask"
diff --git a/code/modules/clothing/masks/smokable.dm b/code/modules/clothing/masks/smokable.dm
index 49aa63a031dd..34327fc8e7ca 100644
--- a/code/modules/clothing/masks/smokable.dm
+++ b/code/modules/clothing/masks/smokable.dm
@@ -9,7 +9,6 @@
var/lit = FALSE
var/waterproof = FALSE
var/type_butt = null
- var/chem_volume = 0
var/smoketime = 0
var/genericmes = "USER lights their NAME with the FLAME."
var/matchmes = "USER lights NAME with FLAME"
@@ -38,7 +37,6 @@
/obj/item/clothing/mask/smokable/Initialize()
. = ..()
atom_flags |= ATOM_FLAG_NO_CHEM_CHANGE // so it doesn't react until you light it
- create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15
/obj/item/clothing/mask/smokable/Destroy()
. = ..()
@@ -223,7 +221,6 @@
/obj/item/clothing/mask/smokable/cigarette/Initialize()
. = ..()
- initialize_reagents()
set_extension(src, /datum/extension/tool, list(TOOL_CAUTERY = TOOL_QUALITY_MEDIOCRE))
/obj/item/clothing/mask/smokable/cigarette/populate_reagents()
@@ -395,7 +392,7 @@
if(!ATOM_IS_OPEN_CONTAINER(glass))
to_chat(user, SPAN_NOTICE("You need to take the lid off first."))
return TRUE
- var/transfered = glass.reagents.trans_to_obj(src, chem_volume)
+ var/transfered = glass.reagents.trans_to_obj(src, glass.reagents.total_volume)
if(transfered) //if reagents were transfered, show the message
to_chat(user, SPAN_NOTICE("You dip \the [src] into \the [glass]."))
else //if not, either the beaker was empty, or the cigarette was full
diff --git a/code/modules/codex/categories/category_substances.dm b/code/modules/codex/categories/category_substances.dm
index acd97e206bcb..1c7763343dbf 100644
--- a/code/modules/codex/categories/category_substances.dm
+++ b/code/modules/codex/categories/category_substances.dm
@@ -55,7 +55,7 @@
material_info += "
This substance has the following properties in standard temperature and pressure: