diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index ac797e16cbd..54388d2c38f 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -46,3 +46,4 @@ #define FLOOR_EDGE_PATH (60 * FLOOR_LAYER_CONSTANT) #define FLOOR_EDGE_GRASS_WILD (65 * FLOOR_LAYER_CONSTANT) #define FLOOR_EDGE_SNOW (70 * FLOOR_LAYER_CONSTANT) +#define FLOOR_EDGE_CARPET (75 * FLOOR_LAYER_CONSTANT) diff --git a/code/game/objects/structures/_structure_materials.dm b/code/game/objects/structures/_structure_materials.dm index 5e76990a22e..bd070bd0a05 100644 --- a/code/game/objects/structures/_structure_materials.dm +++ b/code/game/objects/structures/_structure_materials.dm @@ -36,7 +36,7 @@ /obj/structure/proc/update_material_name(var/override_name) var/base_name = override_name || initial(name) if(istype(material)) - SetName("[material.solid_name] [base_name]") + SetName("[material.adjective_name] [base_name]") else SetName(base_name) diff --git a/code/game/objects/structures/barrel.dm b/code/game/objects/structures/barrel.dm index 5281d7dfcef..20d0c9d6eb2 100644 --- a/code/game/objects/structures/barrel.dm +++ b/code/game/objects/structures/barrel.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/structures/barrel.dmi' icon_state = ICON_STATE_WORLD anchored = TRUE - atom_flags = ATOM_FLAG_CLIMBABLE | ATOM_FLAG_OPEN_CONTAINER + atom_flags = ATOM_FLAG_CLIMBABLE matter = null material = /decl/material/solid/organic/wood color = /decl/material/solid/organic/wood::color @@ -42,9 +42,21 @@ return var/primary_mat = reagents?.get_primary_reagent_name() if(primary_mat) - SetName("[material.solid_name] [initial(name)] of [primary_mat]") + update_material_name("[initial(name)] of [primary_mat]") else - SetName("[material.solid_name] [initial(name)]") + update_material_name() + update_icon() + +/obj/structure/reagent_dispensers/barrel/on_update_icon() + . = ..() + if(ATOM_IS_OPEN_CONTAINER(src)) + if(reagents) + var/overlay_amount = NONUNIT_CEILING(reagents.total_liquid_volume / reagents.maximum_volume * 100, 10) + var/image/filling_overlay = overlay_image(icon, "[icon_state]-[overlay_amount]", reagents.get_color(), RESET_COLOR | RESET_ALPHA) + add_overlay(filling_overlay) + add_overlay(overlay_image(icon, "[icon_state]-lidopen", material.color, RESET_COLOR)) + else + add_overlay(overlay_image(icon, "[icon_state]-lidclosed", material.color, RESET_COLOR)) /obj/structure/reagent_dispensers/barrel/ebony material = /decl/material/solid/organic/wood/ebony diff --git a/code/game/turfs/flooring/flooring_carpet.dm b/code/game/turfs/flooring/flooring_carpet.dm index 1158eb56ff1..79a30eb7ff4 100644 --- a/code/game/turfs/flooring/flooring_carpet.dm +++ b/code/game/turfs/flooring/flooring_carpet.dm @@ -3,6 +3,7 @@ desc = "Comfy and fancy carpeting." icon = 'icons/turf/flooring/carpet.dmi' icon_base = "brown" + icon_edge_layer = FLOOR_EDGE_CARPET build_type = /obj/item/stack/tile/carpet damage_temperature = T0C+200 flooring_flags = TURF_REMOVE_CROWBAR | TURF_CAN_BURN diff --git a/code/game/turfs/floors/_floor.dm b/code/game/turfs/floors/_floor.dm index 0dd9e8e4365..d3d49d39745 100644 --- a/code/game/turfs/floors/_floor.dm +++ b/code/game/turfs/floors/_floor.dm @@ -45,7 +45,7 @@ set_flooring(GET_DECL(floortype), skip_update = TRUE) if(fill_reagent_type && get_physical_height() < 0) - add_to_reagents(fill_reagent_type, abs(height)) + add_to_reagents(fill_reagent_type, abs(height), phase = MAT_PHASE_LIQUID) if(floor_material || get_topmost_flooring()) if(ml) @@ -110,11 +110,17 @@ /turf/floor/proc/get_base_flooring() RETURN_TYPE(/decl/flooring) - return istype(_base_flooring) ? _base_flooring : null + if(ispath(_base_flooring)) + return GET_DECL(_base_flooring) + return _base_flooring /turf/floor/proc/get_topmost_flooring() RETURN_TYPE(/decl/flooring) - return istype(_flooring) ? _flooring : get_base_flooring() + if(isnull(_flooring)) + return get_base_flooring() + if(ispath(_flooring)) + return GET_DECL(_flooring) + return _flooring /turf/floor/proc/set_flooring(var/decl/flooring/newflooring, skip_update, place_product) diff --git a/code/game/turfs/floors/floor_icon.dm b/code/game/turfs/floors/floor_icon.dm index 656b0cf3aeb..16b41e64ec8 100644 --- a/code/game/turfs/floors/floor_icon.dm +++ b/code/game/turfs/floors/floor_icon.dm @@ -209,39 +209,37 @@ if(!istype(origin) || !istype(opponent)) return FALSE - . = FALSE - //is_wall is true for wall turfs and for floors containing a low wall - if(opponent.is_wall()) - if(wall_smooth == SMOOTH_ALL) - . = TRUE - //If is_hole is true, then it's space or openspace - else if(opponent.is_open()) - if(space_smooth == SMOOTH_ALL) - . = TRUE - - //If we get here then its a normal floor - else if (istype(opponent, /turf/floor)) + // Just a normal floor + if (istype(opponent, /turf/floor)) var/turf/floor/floor_opponent = opponent var/decl/flooring/opponent_flooring = floor_opponent.get_topmost_flooring() if (floor_smooth == SMOOTH_ALL) - . = TRUE + return TRUE //If the floor is the same as us,then we're linked, else if (istype(opponent_flooring, neighbour_type)) - . = TRUE + return TRUE //If we get here it must be using a whitelist or blacklist else if (floor_smooth == SMOOTH_WHITELIST) if (flooring_whitelist[opponent_flooring.type]) //Found a match on the typecache - . = TRUE + return TRUE else if(floor_smooth == SMOOTH_BLACKLIST) - . = TRUE //Default to true for the blacklist, then make it false if a match comes up - if (flooring_blacklist[opponent_flooring.type]) - //Found a match on the typecache - . = FALSE + if (flooring_blacklist[opponent_flooring.type]) {EMPTY_BLOCK_GUARD} else + //No match on the typecache + return TRUE //Check for window frames. - if (!. && wall_smooth == SMOOTH_ALL) + if (wall_smooth == SMOOTH_ALL) if(locate(/obj/structure/wall_frame) in opponent) - . = TRUE + return TRUE + // Wall turf + else if(opponent.is_wall()) + if(wall_smooth == SMOOTH_ALL) + return TRUE + //If is_open is true, then it's space or openspace + else if(opponent.is_open()) + if(space_smooth == SMOOTH_ALL) + return TRUE + return FALSE /decl/flooring/proc/symmetric_test_link(var/turf/A, var/turf/B) return test_link(A, B) && test_link(B,A) diff --git a/code/game/turfs/floors/subtypes/floor_natural.dm b/code/game/turfs/floors/subtypes/floor_natural.dm index e1620e5b899..4b6b98437d5 100644 --- a/code/game/turfs/floors/subtypes/floor_natural.dm +++ b/code/game/turfs/floors/subtypes/floor_natural.dm @@ -11,7 +11,7 @@ color = "#41311b" _base_flooring = /decl/flooring/dirt -/turf/floor/dirt/walnut +/turf/floor/wood/walnut name = "wooden floor" icon = 'icons/turf/flooring/wood.dmi' icon_state = "wood" diff --git a/code/game/turfs/turf_fluids.dm b/code/game/turfs/turf_fluids.dm index 8779313e061..e7667b29bd5 100644 --- a/code/game/turfs/turf_fluids.dm +++ b/code/game/turfs/turf_fluids.dm @@ -103,7 +103,7 @@ create_reagents(FLUID_MAX_DEPTH) return ..() -/turf/add_to_reagents(reagent_type, amount, data, safety = FALSE, defer_update = FALSE) +/turf/add_to_reagents(reagent_type, amount, data, safety = FALSE, defer_update = FALSE, phase) if(!reagents) create_reagents(FLUID_MAX_DEPTH) return ..() diff --git a/code/modules/materials/definitions/liquids/materials_liquid_soup.dm b/code/modules/materials/definitions/liquids/materials_liquid_soup.dm index 2e3f43996b8..089fc5ecaea 100644 --- a/code/modules/materials/definitions/liquids/materials_liquid_soup.dm +++ b/code/modules/materials/definitions/liquids/materials_liquid_soup.dm @@ -4,6 +4,8 @@ nutriment_factor = 4 hydration_factor = 5 // Per removed amount each tick glass_name = "soup" + melting_point = T0C // We assume soup is water-based by default and so it freezes at 0C. + boiling_point = null // It kind of sucks for your soup to boil away honestly var/mask_name_suffix = "soup" /decl/material/liquid/nutriment/soup/get_presentation_name(var/obj/item/prop) @@ -26,19 +28,21 @@ var/allergen_flags = ALLERGEN_NONE var/list/ingredients = list() + var/new_fraction = newamount / REAGENT_VOLUME(reagents, type) // the fraction of the total reagent volume that the new data is associated with + var/old_fraction = 1 - new_fraction . = ..() if(islist(.) && length(.)) allergen_flags |= .["allergen_flags"] var/list/old_ingredients = .["soup_ingredients"] for(var/ingredient in old_ingredients) - ingredients[ingredient] += old_ingredients[ingredient] + ingredients[ingredient] += old_ingredients[ingredient] * old_fraction if(islist(newdata) && length(newdata)) allergen_flags |= newdata["allergen_flags"] var/list/new_ingredients = newdata["soup_ingredients"] for(var/ingredient in new_ingredients) - ingredients[ingredient] += new_ingredients[ingredient] + ingredients[ingredient] += new_ingredients[ingredient] * new_fraction if(length(ingredients)) ingredients = sortTim(ingredients, /proc/cmp_numeric_dsc, associative = TRUE) diff --git a/code/modules/materials/definitions/solids/materials_solid_wood.dm b/code/modules/materials/definitions/solids/materials_solid_wood.dm index 9dea72c5cdd..6a6f23c98ba 100644 --- a/code/modules/materials/definitions/solids/materials_solid_wood.dm +++ b/code/modules/materials/definitions/solids/materials_solid_wood.dm @@ -16,6 +16,7 @@ 'icons/turf/walls/log.dmi' = TRUE, 'icons/turf/walls/metal.dmi' = TRUE ) + table_icon_base = "wood" bench_icon = 'icons/obj/structures/wood_benches.dmi' pew_icon = 'icons/obj/structures/wood_pews.dmi' explosion_resistance = 2 diff --git a/code/modules/random_map/noise/forage.dm b/code/modules/random_map/noise/forage.dm index 72dd620ec1b..de983ba7810 100644 --- a/code/modules/random_map/noise/forage.dm +++ b/code/modules/random_map/noise/forage.dm @@ -117,56 +117,64 @@ return /datum/random_map/noise/forage/get_additional_spawns(value, turf/T) + if(!istype(T, /turf/floor)) + return + var/turf/floor/floor = T + var/decl/flooring/flooring = floor.get_topmost_flooring() var/parse_value = noise2value(value) var/place_prob var/place_type - if(T.is_outside()) - if(istype(T, /turf/floor/rock)) + if(floor.is_outside()) + if(istype(flooring, /decl/flooring/rock)) if(prob(15)) // Static as current map has limited amount of rock turfs var/rock_type = SAFEPICK(forage["rocks"]) - new rock_type(T) + new rock_type(floor) return - else if(istype(T, /turf/floor/grass)) + if(istype(flooring, /decl/flooring/grass)) if(prob(parse_value * tree_weight)) if(length(trees)) var/tree_type = pickweight(trees) - new tree_type(T) + new tree_type(floor) return place_prob = parse_value * forage_weight place_type = SAFEPICK(forage["grass"]) - else if(istype(T, /turf/floor/mud/water/deep)) - place_prob = parse_value * forage_weight - place_type = SAFEPICK(forage["riverbed"]) - else if(istype(T, /turf/floor/mud/water)) - place_prob = parse_value * forage_weight - place_type = SAFEPICK(forage["shallows"]) - else if(istype(T, /turf/floor/mud)) - place_prob = parse_value * forage_weight - place_type = SAFEPICK(forage["riverbank"]) // no entries by default, expanded on subtypes + if(istype(flooring, /decl/flooring/mud)) + switch(floor.get_fluid_depth()) + if(FLUID_OVER_MOB_HEAD to FLUID_MAX_DEPTH) + place_prob = parse_value * forage_weight + place_type = SAFEPICK(forage["riverbed"]) + if(FLUID_SLURRY to FLUID_OVER_MOB_HEAD) + place_prob = parse_value * forage_weight + place_type = SAFEPICK(forage["shallows"]) + else + place_prob = parse_value * forage_weight + place_type = SAFEPICK(forage["riverbank"]) // no entries by default, expanded on subtypes else - if(istype(T, /turf/floor/mud) && !istype(T, /turf/floor/mud/water/deep)) - if(prob(parse_value * cave_tree_weight)) - if(length(cave_trees)) - var/tree_type = pick(cave_trees) - new tree_type(T) - return - place_prob = parse_value * cave_forage_weight * 2 - place_type = SAFEPICK(forage["caves"]) - else if(istype(T, /turf/floor/dirt)) + if(istype(flooring, /decl/flooring/mud)) + switch(floor.get_fluid_depth()) + if(FLUID_SLURRY to FLUID_OVER_MOB_HEAD) + place_prob = parse_value * cave_forage_weight + place_type = SAFEPICK(forage["cave_shallows"]) + if(0 to FLUID_SLURRY) + if(prob(parse_value * cave_tree_weight)) + if(length(cave_trees)) + var/tree_type = pick(cave_trees) + new tree_type(floor) + return + place_prob = parse_value * cave_forage_weight * 2 + place_type = SAFEPICK(forage["caves"]) + else if(istype(flooring, /decl/flooring/dirt)) place_prob = parse_value * cave_forage_weight place_type = SAFEPICK(forage["caves"]) - else if(istype(T, /turf/floor/mud/water)) - place_prob = parse_value * cave_forage_weight - place_type = SAFEPICK(forage["cave_shallows"]) if(place_type && prob(place_prob)) if(istype(place_type, /datum/seed)) - new /obj/structure/flora/plant(T, null, null, place_type) + new /obj/structure/flora/plant(floor, null, null, place_type) for(var/stepdir in global.alldirs) if(prob(15)) - var/turf/neighbor = get_step(T, stepdir) - if(istype(neighbor, T.type) && !(locate(/obj/structure/flora/plant) in neighbor)) + var/turf/neighbor = get_step(floor, stepdir) + if(istype(neighbor, floor.type) && !(locate(/obj/structure/flora/plant) in neighbor)) new /obj/structure/flora/plant(neighbor, null, null, place_type) else if(ispath(place_type, /atom)) - new place_type(T) + new place_type(floor) diff --git a/html/changelog.html b/html/changelog.html index 51c853c8ceb..5764b2b41d6 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -201,19 +201,6 @@