diff --git a/code/_helpers/type2type.dm b/code/_helpers/type2type.dm index 2cd597169bd9..d5178a090939 100644 --- a/code/_helpers/type2type.dm +++ b/code/_helpers/type2type.dm @@ -1,13 +1,17 @@ /* * Holds procs designed to change one type of value, into another. * Contains: - * text2list & list2text + * alist2list * file2list * angle2dir * angle2text - * worldtime2text */ +/proc/alist2list(alist/input) + . = list() + for(var/k,v in input) + .[k] = v + // Splits the text of a file at seperator and returns them in a list. /proc/file2list(filename, seperator = "\n") return splittext(safe_file2text(filename), seperator) diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm index 22c582f53a8f..f76dea523fa2 100644 --- a/code/game/base_turf.dm +++ b/code/game/base_turf.dm @@ -34,7 +34,7 @@ // 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)) + if(!istype(T) || !HasBelow(T.z)) return var/turf/below = T while ((below = GetBelow(below))) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 1770f09178cc..5b72753a9e6d 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -159,7 +159,7 @@ TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K var/decl/environment_data/env_info = GET_DECL(environment_type) - for(var/g in decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + for(var/g in get_filterable_material_types()) if(!env_info.important_gasses[g]) trace_gas += g // not everything in these lists is a subtype of /decl/material/gas, so: diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index b6989e112bdd..80e331893ec2 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -24,7 +24,7 @@ . = ..() if(!scrubbing_gas) scrubbing_gas = list() - for(var/g in decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + for(var/g in get_filterable_material_types()) if(g != /decl/material/gas/oxygen && g != /decl/material/gas/nitrogen) scrubbing_gas += g diff --git a/code/game/objects/effects/_effect.dm b/code/game/objects/effects/_effect.dm index 2547b4525b9f..d7b2823e0d7d 100644 --- a/code/game/objects/effects/_effect.dm +++ b/code/game/objects/effects/_effect.dm @@ -1,2 +1,8 @@ /obj/effect abstract_type = /obj/effect + +/obj/effect/can_be_grabbed(var/mob/grabber, var/target_zone) + return FALSE + +/obj/effect/try_make_grab(mob/living/user, defer_hand = FALSE) + return FALSE diff --git a/code/game/turfs/flooring/_flooring.dm b/code/game/turfs/flooring/_flooring.dm index f5f8083873f8..a93566d69e38 100644 --- a/code/game/turfs/flooring/_flooring.dm +++ b/code/game/turfs/flooring/_flooring.dm @@ -19,6 +19,7 @@ var/global/list/flooring_cache = list() var/color = COLOR_WHITE var/footstep_type = /decl/footsteps/plating var/growth_value = 0 + var/deconstruct_sound var/neighbour_type @@ -295,7 +296,8 @@ var/global/list/flooring_cache = list() return TRUE to_chat(user, SPAN_NOTICE("You remove the [get_surface_descriptor()] with \the [item].")) floor.remove_flooring(floor.get_topmost_flooring(), place_product = TRUE) - playsound(floor, 'sound/items/Deconstruct.ogg', 80, 1) + if(deconstruct_sound) + playsound(floor, deconstruct_sound, 80, 1) return TRUE if(constructed) diff --git a/code/game/turfs/flooring/flooring_reinforced.dm b/code/game/turfs/flooring/flooring_reinforced.dm index 38234d29ce8e..a48566d08613 100644 --- a/code/game/turfs/flooring/flooring_reinforced.dm +++ b/code/game/turfs/flooring/flooring_reinforced.dm @@ -24,6 +24,7 @@ "broken4" ) uid = "floor_reinf" + deconstruct_sound = 'sound/items/Deconstruct.ogg' /decl/flooring/reinforced/circuit name = "processing strata" diff --git a/code/game/turfs/flooring/flooring_tiled.dm b/code/game/turfs/flooring/flooring_tiled.dm index e2b4af68c879..4b762fffeef1 100644 --- a/code/game/turfs/flooring/flooring_tiled.dm +++ b/code/game/turfs/flooring/flooring_tiled.dm @@ -15,6 +15,8 @@ space_smooth = SMOOTH_ALL constructed = TRUE gender = NEUTER + deconstruct_sound = 'sound/items/Deconstruct.ogg' + burned_states = list( "burned0", "burned1" @@ -87,6 +89,7 @@ color = null build_type = null uid = "floor_tiled_new" + deconstruct_sound = 'sound/items/Deconstruct.ogg' /decl/flooring/tiling/new_tile/cargo_one icon_base = "cargo_one_full" diff --git a/code/game/turfs/floors/subtypes/floor_reinforced.dm b/code/game/turfs/floors/subtypes/floor_reinforced.dm index 5ea377aa3961..551786ed357b 100644 --- a/code/game/turfs/floors/subtypes/floor_reinforced.dm +++ b/code/game/turfs/floors/subtypes/floor_reinforced.dm @@ -1,8 +1,8 @@ /turf/floor/reinforced - name = "reinforced floor" - icon = 'icons/turf/flooring/tiles.dmi' - icon_state = "reinforced" - _flooring = /decl/flooring/reinforced + name = "reinforced floor" + icon = 'icons/turf/flooring/tiles.dmi' + icon_state = "reinforced" + _flooring = /decl/flooring/reinforced /turf/floor/reinforced/airless initial_gas = null diff --git a/code/game/turfs/turf_ramps.dm b/code/game/turfs/turf_ramps.dm index 41a447f92064..a969376f1af9 100644 --- a/code/game/turfs/turf_ramps.dm +++ b/code/game/turfs/turf_ramps.dm @@ -1,3 +1,9 @@ /turf/proc/handle_ramp_dug_below(turf/wall/natural/ramp) if(simulated && !is_open()) - ChangeTurf(get_base_turf(z)) + ChangeTurf(get_open_turf_type(src)) + return TRUE + return FALSE + +/turf/floor/handle_ramp_dug_below(turf/wall/natural/ramp) + var/decl/flooring/floor = get_topmost_flooring() + return !floor.constructed && ..() diff --git a/code/game/turfs/walls/wall_icon.dm b/code/game/turfs/walls/wall_icon.dm index 94ca6d9b6eca..ee87ca410015 100644 --- a/code/game/turfs/walls/wall_icon.dm +++ b/code/game/turfs/walls/wall_icon.dm @@ -112,6 +112,7 @@ other_connections = dirs_to_corner_states(other_dirs) /turf/wall/proc/update_wall_icon() + var/material_icon_base = get_wall_icon() var/base_color = get_base_color() diff --git a/code/game/turfs/walls/wall_natural_icon.dm b/code/game/turfs/walls/wall_natural_icon.dm index 715297e7339b..f19a8db6c4d6 100644 --- a/code/game/turfs/walls/wall_natural_icon.dm +++ b/code/game/turfs/walls/wall_natural_icon.dm @@ -52,7 +52,7 @@ var/turf/floor_data = floor_type new_icon = initial(floor_data.icon) new_icon_state = initial(floor_data.icon_state) - new_color = initial(floor_data.color) + new_color = base_color var/turf/wall/natural/neighbor = get_step(src, turn(ramp_slope_direction, -90)) var/has_left_neighbor = istype(neighbor) && neighbor.ramp_slope_direction == ramp_slope_direction @@ -65,10 +65,10 @@ state = "ramp-blend-left" else if(has_right_neighbor) state = "ramp-blend-right" - var/image/I = image(material_icon_base, state, dir = ramp_slope_direction) + var/image/I = image(icon = material_icon_base, icon_state = state, dir = ramp_slope_direction) add_overlay(I) if(shine) - I = image(material_icon_base, "[state]-shine", dir = ramp_slope_direction) + I = image(icon = material_icon_base, icon_state = "[state]-shine", dir = ramp_slope_direction) I.appearance_flags |= RESET_ALPHA I.alpha = shine add_overlay(I) diff --git a/code/game/turfs/walls/wall_natural_ramps.dm b/code/game/turfs/walls/wall_natural_ramps.dm index 3ec738ff1221..c36d31b5bd87 100644 --- a/code/game/turfs/walls/wall_natural_ramps.dm +++ b/code/game/turfs/walls/wall_natural_ramps.dm @@ -4,40 +4,23 @@ 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 - density = FALSE - opacity = FALSE - - // Pretend to be a normal floor turf under the ramp. - var/turf/under = floor_type - icon = initial(under.icon) - icon_state = initial(under.icon_state) - color = initial(under.color) - - decals = null - var/turf/ramp_above = GetAbove(src) - if(ramp_above) - ramp_above.handle_ramp_dug_below(src) - update_neighboring_ramps() - - else - + if(!ramp_slope_direction) user?.visible_message(SPAN_NOTICE("\The [user] clears out \the [src].")) - - permit_ao = initial(permit_ao) - blocks_air = initial(blocks_air) - density = initial(density) - color = initial(color) - refresh_opacity() - - icon = 'icons/turf/walls/natural.dmi' - icon_state = "blank" + ChangeTurf(floor_type) + return + + user?.visible_message(SPAN_NOTICE("\The [user] digs out \the [src], forming a ramp.")) + drop_ore() + permit_ao = FALSE + blocks_air = FALSE + density = FALSE + opacity = FALSE + decals = null + var/turf/ramp_above = GetAbove(src) + if(ramp_above) + ramp_above.handle_ramp_dug_below(src) + update_neighboring_ramps() + update_icon() if(!skip_icon_update) for(var/turf/wall/natural/neighbor in RANGE_TURFS(src, 1)) diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 9288165c9b4a..7fd10e57eb41 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -55,9 +55,8 @@ /decl/atmos_grief_fix_step/reset_turfs/act() var/list/unsorted_overlays = list() - var/list/all_gasses = decls_repository.get_decls_of_subtype(/decl/material/gas) - for(var/id in all_gasses) - var/decl/material/mat = all_gasses[id] + for(var/id,m in get_filterable_material_types()) + var/decl/material/mat = m unsorted_overlays |= mat.gas_tile_overlay for(var/turf/T in world) diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index 2a2aac82fd5e..58fdc8f1717e 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -64,7 +64,7 @@ id_tag = "[sequential_id("obj/machinery")]" if(!scrubbing_gas) scrubbing_gas = list() - for(var/g in decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + for(var/g in get_filterable_material_types()) if(g != /decl/material/gas/oxygen && g != /decl/material/gas/nitrogen) scrubbing_gas += g . = ..() diff --git a/code/modules/maps/template_types/random_exoplanet/fauna_generator.dm b/code/modules/maps/template_types/random_exoplanet/fauna_generator.dm index c3b05683b86b..08cbad00e174 100644 --- a/code/modules/maps/template_types/random_exoplanet/fauna_generator.dm +++ b/code/modules/maps/template_types/random_exoplanet/fauna_generator.dm @@ -126,7 +126,7 @@ /datum/fauna_generator/proc/generate_breathable_gases(var/datum/gas_mixture/atmosphere, var/list/breath_gases, var/list/toxic_gases) //Set up gases for living things - var/list/all_gasses = decls_repository.get_decl_paths_of_subtype(/decl/material/gas) + var/list/all_gasses = get_filterable_material_types(as_list = TRUE) if(!length(breath_gases)) var/list/goodgases = all_gasses.Copy() var/gasnum = min(rand(1,3), goodgases.len) diff --git a/code/modules/materials/_materials.dm b/code/modules/materials/_materials.dm index 2ed880fd3b89..920e63862dc2 100644 --- a/code/modules/materials/_materials.dm +++ b/code/modules/materials/_materials.dm @@ -1,3 +1,20 @@ +var/global/alist/_filterable_mats_alist +var/global/list/_filterable_mats_list + +/proc/get_filterable_material_types(as_list = FALSE) + + if(isnull(_filterable_mats_alist)) + _filterable_mats_alist = alist() + for(var/decl/material/mat in decls_repository.get_decls_of_subtype_unassociated(/decl/material)) + if(!isnull(mat.boiling_point)) + _filterable_mats_alist[mat.type] = mat + + if(as_list) + if(isnull(_filterable_mats_list)) + _filterable_mats_list = alist2list(_filterable_mats_alist) + return _filterable_mats_list + return _filterable_mats_alist + /* MATERIAL DECLS This data is used by various parts of the game for basic physical properties and behaviors diff --git a/code/modules/materials/definitions/liquids/_mat_liquid.dm b/code/modules/materials/definitions/liquids/_mat_liquid.dm index 5f1c7b5dad12..e38d0dd33063 100644 --- a/code/modules/materials/definitions/liquids/_mat_liquid.dm +++ b/code/modules/materials/definitions/liquids/_mat_liquid.dm @@ -7,6 +7,9 @@ latent_heat = 2258 abstract_type = /decl/material/liquid accelerant_value = FUEL_VALUE_SUPPRESSANT // Abstract way of dousing fires with fluid; realistically it should deprive them of oxidizer but heigh ho + // Assume if we're dealing with stacks, then it's solid (like ice) + sound_manipulate = 'sound/foley/rockscrape.ogg' + sound_dropped = 'sound/foley/rockscrape.ogg' /decl/material/liquid/Initialize() if(!gas_name) diff --git a/code/modules/materials/definitions/solids/materials_solid_ice.dm b/code/modules/materials/definitions/solids/materials_solid_ice.dm index a86600f193db..fc679cc6a9be 100644 --- a/code/modules/materials/definitions/solids/materials_solid_ice.dm +++ b/code/modules/materials/definitions/solids/materials_solid_ice.dm @@ -43,6 +43,8 @@ dug_drop_type = /obj/item/stack/material/ore/handful default_solid_form = /obj/item/stack/material/lump/large can_backfill_floor_type = /decl/flooring/snow + sound_manipulate = 'sound/foley/paperpickup2.ogg' + sound_dropped = 'sound/foley/paperpickup1.ogg' /decl/material/solid/ice/snow/handle_stain_dry(obj/effect/decal/cleanable/blood/stain) var/ambient_temperature = stain.get_ambient_temperature() diff --git a/code/modules/materials/definitions/solids/materials_solid_mineral.dm b/code/modules/materials/definitions/solids/materials_solid_mineral.dm index d88305ae97c7..40396f7316e7 100644 --- a/code/modules/materials/definitions/solids/materials_solid_mineral.dm +++ b/code/modules/materials/definitions/solids/materials_solid_mineral.dm @@ -236,6 +236,8 @@ dug_drop_type = /obj/item/stack/material/ore/handful default_solid_form = /obj/item/stack/material/ore/handful can_backfill_floor_type = /decl/flooring/sand + sound_manipulate = 'sound/foley/paperpickup2.ogg' + sound_dropped = 'sound/foley/paperpickup1.ogg' /decl/material/solid/clay name = "clay" @@ -261,6 +263,8 @@ can_backfill_floor_type = /decl/flooring/clay gemstone_chance = 0.01 gemstone_types = list(/decl/material/solid/gemstone/sapphire = 1) + sound_manipulate = 'sound/foley/paperpickup2.ogg' + sound_dropped = 'sound/foley/paperpickup1.ogg' /decl/material/solid/soil name = "soil" @@ -281,6 +285,8 @@ ) solution_name = "mud" coated_adjective = "muddy" + sound_manipulate = 'sound/foley/paperpickup2.ogg' + sound_dropped = 'sound/foley/paperpickup1.ogg' // todo: make mud either its own material or a mix of dirt and water // or let dirt be in the liquid volumes list for mud? diff --git a/code/modules/materials/definitions/solids/materials_solid_stone.dm b/code/modules/materials/definitions/solids/materials_solid_stone.dm index 5cdac448041c..3bb5692d7769 100644 --- a/code/modules/materials/definitions/solids/materials_solid_stone.dm +++ b/code/modules/materials/definitions/solids/materials_solid_stone.dm @@ -30,6 +30,7 @@ /decl/material/solid/stone/Initialize() . = ..() texture = image('icons/turf/wall_texture.dmi', "concrete") + texture.appearance_flags |= RESET_COLOR | RESET_ALPHA texture.blend_mode = BLEND_MULTIPLY /decl/material/solid/stone/get_wall_texture() diff --git a/code/modules/xenoarcheaology/artifacts/effects/gas_generation.dm b/code/modules/xenoarcheaology/artifacts/effects/gas_generation.dm index 0d636d1a9bb5..e2745e3f2694 100644 --- a/code/modules/xenoarcheaology/artifacts/effects/gas_generation.dm +++ b/code/modules/xenoarcheaology/artifacts/effects/gas_generation.dm @@ -5,7 +5,7 @@ /datum/artifact_effect/gas/New() ..() if(!spawned_gas) - spawned_gas = pick(decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + spawned_gas = pick(get_filterable_material_types(as_list = TRUE)) operation_type = pick((XA_EFFECT_TOUCH), (XA_EFFECT_AURA)) origin_type = XA_EFFECT_SYNTH diff --git a/code/modules/xenoarcheaology/artifacts/triggers/gas.dm b/code/modules/xenoarcheaology/artifacts/triggers/gas.dm index 4c970db3bb25..c5c431d4b4e6 100644 --- a/code/modules/xenoarcheaology/artifacts/triggers/gas.dm +++ b/code/modules/xenoarcheaology/artifacts/triggers/gas.dm @@ -5,7 +5,7 @@ /datum/artifact_trigger/gas/New() if(!gas_needed) - gas_needed = list(pick(decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) = rand(1,10)) + gas_needed = list(pick(get_filterable_material_types(as_list = TRUE)) = rand(1,10)) var/decl/material/gas/gas = GET_DECL(gas_needed[1]) name = "concentration of [gas.name]" diff --git a/code/modules/xenoarcheaology/finds/find_types/mundane.dm b/code/modules/xenoarcheaology/finds/find_types/mundane.dm index 7d1ea51ec777..211c5733dc4d 100644 --- a/code/modules/xenoarcheaology/finds/find_types/mundane.dm +++ b/code/modules/xenoarcheaology/finds/find_types/mundane.dm @@ -22,7 +22,7 @@ "It's like no [item_type] you've ever seen before.", "It's a mystery how anyone is supposed to eat with this.", "You wonder what the creator's mouth was shaped like.") - + // Coin /decl/archaeological_find/coin item_type = "coin" @@ -56,7 +56,7 @@ /decl/archaeological_find/tank/spawn_item(atom/loc) var/obj/item/tank/new_item = ..() new_item.air_contents.gas.Cut() - new_item.air_contents.adjust_gas(pick(decls_repository.get_decl_paths_of_subtype(/decl/material/gas)),15) + new_item.air_contents.adjust_gas(pick(get_filterable_material_types(as_list = TRUE)),15) return new_item /decl/archaeological_find/tank/generate_name() diff --git a/code/unit_tests/atmospherics_tests.dm b/code/unit_tests/atmospherics_tests.dm index 0fa4febe7d55..e28fcc06a378 100644 --- a/code/unit_tests/atmospherics_tests.dm +++ b/code/unit_tests/atmospherics_tests.dm @@ -39,7 +39,7 @@ /datum/unit_test/atmos_machinery/proc/check_moles_conserved(var/case_name, var/list/before_gas_mixes, var/list/after_gas_mixes) var/failed = FALSE - for(var/gasid in decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + for(var/gasid in get_filterable_material_types()) var/before = 0 for(var/gasmix in before_gas_mixes) var/datum/gas_mixture/G = before_gas_mixes[gasmix] @@ -195,7 +195,7 @@ name = "ATMOS MACHINERY: scrub_gas() Conserves Moles" /datum/unit_test/atmos_machinery/conserve_moles/scrub_gas/start_test() - var/list/filtering = decls_repository.get_decl_paths_of_subtype(/decl/material/gas) + var/list/filtering = get_filterable_material_types(as_list = TRUE) for(var/case_name in test_cases) var/gas_mix_data = test_cases[case_name] var/list/before_gas_mixes = create_gas_mixes(gas_mix_data) @@ -211,7 +211,7 @@ name = "ATMOS MACHINERY: filter_gas() Conserves Moles" /datum/unit_test/atmos_machinery/conserve_moles/filter_gas/start_test() - var/list/filtering = decls_repository.get_decl_paths_of_subtype(/decl/material/gas) + var/list/filtering = get_filterable_material_types(as_list = TRUE) for(var/case_name in test_cases) var/gas_mix_data = test_cases[case_name] var/list/before_gas_mixes = create_gas_mixes(gas_mix_data) @@ -231,7 +231,7 @@ var/list/after_gas_mixes = create_gas_mixes(gas_mix_data) var/list/filtering = list() - for(var/gasid in decls_repository.get_decl_paths_of_subtype(/decl/material/gas)) + for(var/gasid in get_filterable_material_types()) filtering[gasid] = after_gas_mixes["sink"] //just filter everything to sink filter_gas_multi(null, filtering, after_gas_mixes["source"], after_gas_mixes["sink"], null, INFINITY) @@ -250,7 +250,7 @@ var/list/after_gas_mixes = create_gas_mixes(gas_mix_data) var/list/mix_sources = list() - var/list/all_gasses = decls_repository.get_decl_paths_of_subtype(/decl/material/gas) + var/list/all_gasses = get_filterable_material_types(as_list = TRUE) var/gas_count = length(all_gasses) for(var/gasid in all_gasses) var/datum/gas_mixture/mix_source = after_gas_mixes["sink"] diff --git a/mods/~compatibility/patches/drakes/fantasy_drakes.dm b/mods/~compatibility/patches/drakes/fantasy_drakes.dm index f2f20a7a00f3..7c9279184ba2 100644 --- a/mods/~compatibility/patches/drakes/fantasy_drakes.dm +++ b/mods/~compatibility/patches/drakes/fantasy_drakes.dm @@ -6,9 +6,6 @@ They are commonly found living in caves or burrows bordering grassland or forest, and while they prefer to hunt deer or rabbits, they will sometimes attack travellers if pickings are slim enough. \ While they are not domesticated, they can be habituated and trained as working animals if captured young enough." -/decl/sprite_accessory/marking/grafadreka - species_allowed = list("Meredrake") - /decl/language/grafadreka desc = "Hiss hiss, feed me rabbits."