Skip to content

Commit

Permalink
Merge pull request #97 from NebulaSS13/dev
Browse files Browse the repository at this point in the history
Updating from Neb dev
  • Loading branch information
MistakeNot4892 authored Oct 12, 2024
2 parents 79f868f + 37d3a03 commit bb7e202
Show file tree
Hide file tree
Showing 25 changed files with 291 additions and 391 deletions.
1 change: 1 addition & 0 deletions code/__defines/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/game/objects/structures/_structure_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
18 changes: 15 additions & 3 deletions code/game/objects/structures/barrel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/flooring/flooring_carpet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions code/game/turfs/floors/_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
40 changes: 19 additions & 21 deletions code/game/turfs/floors/floor_icon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/game/turfs/floors/subtypes/floor_natural.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/turf_fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 38 additions & 30 deletions code/modules/random_map/noise/forage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 0 additions & 13 deletions html/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,6 @@ <h3 class="author">Penelope Haze updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Mortars (for grinding) are now capable of holding more than one item at a time.</li>
</ul>

<h2 class="date">09 August 2024</h2>
<h3 class="author">Penelope Haze updated:</h3>
<ul class="changes bgimages16">
<li class="imageadd">added better compost bin sprites, based on those from Sunset Wasteland</li>
<li class="imageadd">added produce bin sprites, modified from Sunset Wasteland's</li>
</ul>

<h2 class="date">08 August 2024</h2>
<h3 class="author">Penelope Haze updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Renamed fire clay goods to earthenware goods.</li>
</ul>
</div>
</td></tr></table>
</body>
Expand Down
Binary file modified icons/obj/structures/barrel.dmi
Binary file not shown.
Binary file modified icons/turf/flooring/grass.dmi
Binary file not shown.
8 changes: 4 additions & 4 deletions maps/shaded_hills/shaded_hills-grassland.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"nl" = (
/obj/structure/door/walnut,
/obj/abstract/exterior_marker/inside,
/turf/floor/dirt/walnut,
/turf/floor/wood/walnut,
/area/shaded_hills/outside)
"oo" = (
/obj/item/stack/material/ore/handful/sand,
Expand Down Expand Up @@ -144,7 +144,7 @@
/area/shaded_hills/caves/unexplored)
"ul" = (
/obj/abstract/exterior_marker/inside,
/turf/floor/dirt/walnut,
/turf/floor/wood/walnut,
/area/shaded_hills/outside)
"vX" = (
/turf/floor/path/running_bond/basalt,
Expand All @@ -159,7 +159,7 @@
/turf/floor/dirt,
/area/shaded_hills/outside)
"xC" = (
/turf/floor/dirt/walnut,
/turf/floor/wood/walnut,
/area/shaded_hills/outside)
"yA" = (
/obj/abstract/landmark/latejoin/observer,
Expand Down Expand Up @@ -188,7 +188,7 @@
/turf/floor/woven,
/area/shaded_hills/outside)
"EE" = (
/turf/floor/dirt/walnut,
/turf/floor/wood/walnut,
/area/shaded_hills/outside/river)
"EL" = (
/obj/abstract/exterior_marker/inside,
Expand Down
Loading

0 comments on commit bb7e202

Please sign in to comment.