-
Notifications
You must be signed in to change notification settings - Fork 222
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
base: dev
Are you sure you want to change the base?
Changes from 3 commits
95170a2
16944db
197842c
b88d45c
5581346
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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 | ||
|
||
/// 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
/turf/wall/proc/refresh_connections() | ||
if(wall_connections && other_connections) | ||
return | ||
|
@@ -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 | ||
|
@@ -124,17 +136,17 @@ | |
|
||
if(apply_reinf_overlay()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Null check on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or in |
||
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. | ||
|
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.