Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wattle, daubed, plastered, and timber-framed walls #4634

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/game/turfs/walls/_wall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var/global/list/wall_fullblend_objects = list(

/turf/wall
name = "wall"
desc = "A huge chunk of metal used to seperate rooms."
desc = "A huge chunk of metal used to separate rooms."
icon = 'icons/turf/walls/_previews.dmi'
icon_state = "solid"
opacity = TRUE
Expand Down Expand Up @@ -51,6 +51,8 @@ var/global/list/wall_fullblend_objects = list(
var/handle_structure_blending = TRUE
var/min_dismantle_amount = 2
var/max_dismantle_amount = 2
/// The reinforcement icon to use. Set in update_material() based on reinf_material.
var/reinf_icon

/// Icon to use if shutter state is non-null.
var/shutter_icon = 'icons/turf/walls/shutter.dmi'
Expand Down
24 changes: 18 additions & 6 deletions code/game/turfs/walls/wall_icon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
if(material)
explosion_resistance = material.explosion_resistance
hitsound = material.hitsound
if(reinf_material && reinf_material.explosion_resistance > explosion_resistance)
explosion_resistance = reinf_material.explosion_resistance
if(reinf_material)
reinf_icon = islist(reinf_material.icon_reinf) ? pick(reinf_material.icon_reinf) : reinf_material.icon_reinf
if(reinf_material.explosion_resistance > explosion_resistance)
explosion_resistance = reinf_material.explosion_resistance
else
reinf_icon = null
update_strings()
refresh_opacity()
SSradiation.resistance_cache.Remove(src)
Expand Down Expand Up @@ -54,6 +58,14 @@
/turf/wall/proc/apply_reinf_overlay()
. = istype(reinf_material)

/// Gets the base wall colour for icon rendering. Can be overridden on wall subtypes. Not equivalent to get_color().
/turf/wall/proc/get_base_color()
return material.color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need an istype() check on material depending on how early you can expect this to get called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's in icon code so would be unsurprised if this runtimes due to material being a type on some neighbor that gets poked during turf init.


/// Gets the reinforcement colour. Can be overridden so that some wall types don't apply paint colour to their reinforcements.
/turf/wall/proc/get_reinf_color()
return paint_color ? paint_color : reinf_material?.color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paint_color || reinf_material?.color ?


/turf/wall/proc/refresh_connections()
if(wall_connections && other_connections)
return
Expand Down Expand Up @@ -100,7 +112,7 @@

/turf/wall/proc/update_wall_icon()
var/material_icon_base = get_wall_icon()
var/base_color = material.color
var/base_color = get_base_color()

var/new_icon
var/new_icon_state
Expand All @@ -124,17 +136,17 @@

if(apply_reinf_overlay())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check on reinf_icon here possibly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or in apply_reinf_overlay()

var/image/I
var/reinf_color = paint_color ? paint_color : reinf_material.color
var/reinf_color = get_reinf_color()
if(construction_stage != null && construction_stage < 6)
I = image('icons/turf/walls/_construction_overlays.dmi', "[construction_stage]")
I.color = reinf_color
add_overlay(I)
else
if(reinf_material.use_reinf_state)
I = image(reinf_material.icon_reinf, reinf_material.use_reinf_state)
I = image(reinf_icon, reinf_material.use_reinf_state)
I.color = reinf_color
else
I = image(_get_wall_subicon(reinf_material.icon_reinf, wall_connections, reinf_color))
I = image(_get_wall_subicon(reinf_icon, wall_connections, reinf_color))
add_overlay(I)

// Update icon on ambient light change, for shutter overlays.
Expand Down
155 changes: 155 additions & 0 deletions code/game/turfs/walls/wall_wattle.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/turf/wall/wattle
icon_state = "wattle"
material = /decl/material/solid/organic/wood/oak
color = /decl/material/solid/organic/wood/oak::color
girder_material = null
floor_type = /turf/floor/dirt
min_dismantle_amount = 3
max_dismantle_amount = 5
shutter_icon = 'icons/turf/walls/square_shutter.dmi'
var/decl/skill/daubing_skill = SKILL_CONSTRUCTION
var/decl/material/daubing_material // todo: daubing as a material made from clay/soil and plant matter?
var/const/matter_to_daub = MATTER_AMOUNT_REINFORCEMENT
// Currently, plastering is done via painting... undecided if that should change in the future.

/turf/wall/wattle/Initialize(ml, materialtype, rmaterialtype)
if(ispath(daubing_material))
daubing_material = GET_DECL(daubing_material)
return ..()

// Daubing with clay or soil
/turf/wall/wattle/attackby(obj/item/W, mob/user, click_params)
if(isnull(daubing_material))
var/static/list/daub_materials = list( // Does not include subtypes.
MistakeNot4892 marked this conversation as resolved.
Show resolved Hide resolved
/decl/material/solid/soil = TRUE,
/decl/material/solid/clay = TRUE
)
if(istype(W, /obj/item/stack/material) && daub_materials[W.material?.type])
if(!user.check_dexterity(DEXTERITY_WIELD_ITEM))
return TRUE
var/obj/item/stack/material/stack = W
var/sheets_to_use = stack.matter_units_to_sheets(matter_to_daub)
if(stack.can_use(sheets_to_use) && user.do_skilled(1 SECOND, daubing_skill, target = src) && stack.can_use(sheets_to_use))
to_chat(user, SPAN_NOTICE("You daub \the [src] with \the [stack]."))
daubing_material = stack.material
stack.use(sheets_to_use)
else if(stack.can_use(sheets_to_use)) // failed the do_skilled
to_chat(user, SPAN_WARNING("You have to stay still to daub \the [src] with \the [stack]."))
else
to_chat(user, SPAN_WARNING("You need [stack.get_string_for_amount(sheets_to_use)] to daub \the [src]."))
return TRUE
return ..()

/turf/wall/wattle/get_dismantle_stack_type()
return /obj/item/stack/material/log // temp?

// daubed walls have the color of their daubing
/turf/wall/wattle/get_base_color()
if(daubing_material)
return "#ae9f70" // daubing_material.color // sorry, but using the daubing material color looks bad
return ..()

// don't plaster over our damn reinforcements
/turf/wall/wattle/get_reinf_color()
return reinf_material?.color

/turf/wall/wattle/get_wall_icon()
if(isnull(daubing_material))
return 'icons/turf/walls/wattle.dmi'
else
return 'icons/turf/walls/wattledaub.dmi'

/turf/wall/wattle/get_dismantle_sound()
return 'sound/foley/wooden_drop.ogg'

/turf/wall/wattle/update_strings()
if(isnull(daubing_material))
if(reinf_material)
SetName("[reinf_material.solid_name]-framed [material.adjective_name] wattle wall")
desc = "A wattle wall made of [material.adjective_name] strips and framed with [reinf_material.solid_name]."
else
SetName("[material.solid_name] wattle wall")
desc = "A wattle wall made of [material.adjective_name] strips."
else if(paint_color)
if(reinf_material)
SetName("[reinf_material.solid_name]-framed plastered wall")
else
SetName("plastered wall")
else
if(reinf_material)
SetName("[reinf_material.solid_name]-framed [material.adjective_name] wattle and daub wall")
desc = "A daubed wattle wall made of [material.adjective_name] strips and framed with [reinf_material.solid_name]."
else
SetName("[material.solid_name] wattle and daub wall")
desc = "A daubed wattle wall made of [material.adjective_name] strips."

/turf/wall/wattle/daubed
icon_state = "wattledaub"
daubing_material = /decl/material/solid/clay
// the daub is lost when destroyed/deconstructed, since it's dried anyway

/turf/wall/wattle/daubed/plastered
icon_state = "plaster"
paint_color = "#c2b8a1" // this is what applies the plaster... icky
color = "#c2b8a1" // preview color for plaster

/turf/wall/wattle/daubed/plastered/framed
icon_state = "framed"
reinf_material = /decl/material/solid/organic/wood/oak
color = /decl/material/solid/organic/wood/oak::color // preview, still painted

// Subtypes.
#define WATTLE_WALL_SUBTYPE(material_name) \
/turf/wall/wattle/##material_name { \
material = /decl/material/solid/organic/wood/##material_name; \
color = /decl/material/solid/organic/wood/##material_name::color; \
}; \
/turf/wall/wattle/##material_name/shutter { \
shutter_state = FALSE; \
icon_state = "wattle_shutter"; \
}; \
/turf/wall/wattle/##material_name/shutter/open { \
shutter_state = TRUE; \
}; \
/turf/wall/wattle/daubed/##material_name { \
material = /decl/material/solid/organic/wood/##material_name; \
color = /decl/material/solid/organic/wood/##material_name::color; \
}; \
/turf/wall/wattle/daubed/##material_name/shutter { \
shutter_state = FALSE; \
icon_state = "wattle_shutter"; \
}; \
/turf/wall/wattle/daubed/##material_name/shutter/open { \
shutter_state = TRUE; \
}; \
/turf/wall/wattle/daubed/plastered/##material_name { \
material = /decl/material/solid/organic/wood/##material_name; \
}; \
/turf/wall/wattle/daubed/plastered/##material_name/shutter { \
shutter_state = FALSE; \
icon_state = "wattle_shutter"; \
}; \
/turf/wall/wattle/daubed/plastered/##material_name/shutter/open { \
shutter_state = TRUE; \
}; \
/turf/wall/wattle/daubed/plastered/framed/##material_name { \
material = /decl/material/solid/organic/wood/##material_name; \
reinf_material = /decl/material/solid/organic/wood/##material_name; \
color = /decl/material/solid/organic/wood/##material_name::color; \
}; \
/turf/wall/wattle/daubed/plastered/framed/##material_name/shutter { \
shutter_state = FALSE; \
icon_state = "wattle_shutter"; \
}; \
/turf/wall/wattle/daubed/plastered/framed/##material_name/shutter/open { \
shutter_state = TRUE; \
}
WATTLE_WALL_SUBTYPE(fungal)
WATTLE_WALL_SUBTYPE(ebony)
WATTLE_WALL_SUBTYPE(walnut)
WATTLE_WALL_SUBTYPE(maple)
WATTLE_WALL_SUBTYPE(mahogany)
WATTLE_WALL_SUBTYPE(bamboo)
WATTLE_WALL_SUBTYPE(yew)

#undef WATTLE_WALL_SUBTYPE
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/modules/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
deactivate_string = "Deactivate Thrusters"

interface_name = "maneuvering jets"
interface_desc = "An inbuilt EVA maneuvering system that runs off a seperate gas supply."
interface_desc = "An inbuilt EVA maneuvering system that runs off a separate gas supply."
origin_tech = @'{"materials":6,"engineering":7}'
material = /decl/material/solid/metal/steel
matter = list(
Expand Down
2 changes: 1 addition & 1 deletion code/modules/codex/entries/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//Normal valves
/datum/codex_entry/atmos_valve
associated_paths = list(/obj/machinery/atmospherics/valve)
mechanics_text = "Click this to turn the valve. If red, the pipes on each end are seperated. Otherwise, they are connected."
mechanics_text = "Click this to turn the valve. If red, the pipes on each end are separated. Otherwise, they are connected."
disambiguator = "atmospherics"
available_to_map_tech_level = MAP_TECH_LEVEL_SPACE

Expand Down
5 changes: 5 additions & 0 deletions code/modules/materials/_material_stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,8 @@
. += " [singular_name]"
return indefinite_article ? "[indefinite_article] [.]" : ADD_ARTICLE(.)
return "[amount] [.] [plural_name]"

/obj/item/stack/material/proc/matter_units_to_sheets(used)
if(!material || get_reinforced_material())
return 0
return ceil(used / matter_per_piece[material.type])
17 changes: 10 additions & 7 deletions code/modules/materials/_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
// Icons
var/icon_base = 'icons/turf/walls/solid.dmi'
var/icon_base_natural = 'icons/turf/walls/natural.dmi'
/// Either the icon used for reinforcement, or a list of icons to pick from.
var/icon_reinf = 'icons/turf/walls/reinforced_metal.dmi'
var/wall_flags = 0
var/list/wall_blend_icons = list() // Which wall icon types walls of this material type will consider blending with. Assoc list (icon path = TRUE/FALSE)
Expand Down Expand Up @@ -563,13 +564,15 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
. += "'[icon_base_natural]' - missing natural shine icon state 'shine[i]'"

if(icon_reinf)
if(use_reinf_state)
if(!check_state_in_icon(use_reinf_state, icon_reinf))
. += "'[icon_reinf]' - missing reinf icon state '[use_reinf_state]'"
else
for(var/i = 0 to 7)
if(!check_state_in_icon("[i]", icon_reinf))
. += "'[icon_reinf]' - missing directional reinf icon state '[i]'"
var/list/all_reinf_icons = islist(icon_reinf) ? icon_reinf : list(icon_reinf)
for(var/sub_icon in all_reinf_icons)
if(use_reinf_state)
if(!check_state_in_icon(use_reinf_state, sub_icon))
. += "'[sub_icon]' - missing reinf icon state '[use_reinf_state]'"
else
for(var/i = 0 to 7)
if(!check_state_in_icon(num2text(i), sub_icon))
. += "'[sub_icon]' - missing directional reinf icon state '[i]'"

if(length(color) != 7)
. += "invalid color (not #RRGGBB)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
'icons/turf/walls/log.dmi' = TRUE,
'icons/turf/walls/metal.dmi' = TRUE
)
icon_reinf = list(
'icons/turf/walls/reinforced_timber.dmi',
'icons/turf/walls/reinforced_timber_alt_1.dmi',
'icons/turf/walls/reinforced_timber_alt_2.dmi',
'icons/turf/walls/reinforced_timber_alt_3.dmi',
'icons/turf/walls/reinforced_timber_alt_4.dmi'
)
use_reinf_state = null
table_icon_base = "wood"
bench_icon = 'icons/obj/structures/wood_benches.dmi'
pew_icon = 'icons/obj/structures/wood_pews.dmi'
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reactions/reaction_compounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
name = "Condensed Capsaicin"
minimum_temperature = 100 CELSIUS
maximum_temperature = 200 CELSIUS // To avoid cooking chili creating condensed capsaicin.
mix_message = "darkens and thickens as it seperates from its water content"
mix_message = "darkens and thickens as it separates from its water content"
required_reagents = list(/decl/material/liquid/capsaicin = 2)
result = list(/decl/material/liquid/capsaicin/condensed = 1)

Expand Down
Binary file modified icons/obj/closets/bases/cabinet.dmi
Binary file not shown.
Binary file modified icons/turf/walls/_previews.dmi
Binary file not shown.
Binary file added icons/turf/walls/plaster.dmi
Binary file not shown.
Binary file added icons/turf/walls/reinforced_timber.dmi
Binary file not shown.
Binary file added icons/turf/walls/reinforced_timber_alt_1.dmi
Binary file not shown.
Binary file added icons/turf/walls/reinforced_timber_alt_2.dmi
Binary file not shown.
Binary file added icons/turf/walls/reinforced_timber_alt_3.dmi
Binary file not shown.
Binary file added icons/turf/walls/reinforced_timber_alt_4.dmi
Binary file not shown.
Binary file added icons/turf/walls/square_shutter.dmi
Binary file not shown.
Binary file added icons/turf/walls/wattle.dmi
Binary file not shown.
Binary file added icons/turf/walls/wattledaub.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,7 @@
#include "code\game\turfs\walls\wall_natural_subtypes.dm"
#include "code\game\turfs\walls\wall_natural_xenoarch.dm"
#include "code\game\turfs\walls\wall_types.dm"
#include "code\game\turfs\walls\wall_wattle.dm"
#include "code\game\verbs\byond_membership.dm"
#include "code\game\verbs\ignore.dm"
#include "code\game\verbs\ooc.dm"
Expand Down
Loading