Skip to content

Commit

Permalink
Merge pull request #4796 from out-of-phaze/feature/doormats
Browse files Browse the repository at this point in the history
Add doormats, modify liquid presentation
  • Loading branch information
MistakeNot4892 authored Feb 1, 2025
2 parents f2423e3 + bc61312 commit 0775a3a
Show file tree
Hide file tree
Showing 20 changed files with 324 additions and 66 deletions.
6 changes: 6 additions & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
#define CONFIG_SERVER_JOIN_WHITELIST 3
#define CONFIG_SERVER_CONNECT_WHITELIST 4

// Coating name color config enums
#define CONFIG_COATING_COLOR_NONE 1
#define CONFIG_COATING_COLOR_MIXTURE 2
#define CONFIG_COATING_COLOR_COMPONENTS 3

// Location for server whitelist file to load from.
#define CONFIG_SERVER_WHITELIST_FILE "config/server_whitelist.txt"

Expand Down Expand Up @@ -252,6 +257,7 @@

//Inserts 'a' or 'an' before X in ways \a doesn't allow
#define ADD_ARTICLE(X) "[(lowertext(X[1]) in global.vowels) ? "an" : "a"] [X]"
#define ADD_ARTICLE_GENDER(X, GENDER) (GENDER == PLURAL ? "some [X]" : ADD_ARTICLE(X))

//Request Console Department Types
#define RC_ASSIST 1 //Request Assistance
Expand Down
15 changes: 13 additions & 2 deletions code/datums/config/config_types/config_game_world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
/decl/config/toggle/humans_need_surnames,
/decl/config/toggle/roundstart_level_generation,
/decl/config/toggle/lights_start_on,
/decl/config/toggle/on/cisnormativity
/decl/config/toggle/on/cisnormativity,
/decl/config/enum/colored_coating_names
)

/decl/config/num/exterior_ambient_light
Expand Down Expand Up @@ -134,4 +135,14 @@

/decl/config/toggle/on/cisnormativity
uid = "cisnormativity"
desc = "If true, when bodytype is changed in character creation, selected pronouns are also changed."
desc = "If true, when bodytype is changed in character creation, selected pronouns are also changed."

/decl/config/enum/colored_coating_names
uid = "colored_coating_names"
desc = "Determines the coloring of various strings representing coatings on objects (blood, oil, mud, etc)."
default_value = CONFIG_COATING_COLOR_MIXTURE
enum_map = list(
"none" = CONFIG_COATING_COLOR_NONE,
"mixture" = CONFIG_COATING_COLOR_MIXTURE,
"components" = CONFIG_COATING_COLOR_COMPONENTS
)
30 changes: 19 additions & 11 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,20 @@
- `user`: The mob examining this atom
- `distance`: The distance this atom is from the `user`
- `infix`: TODO
- `suffix`: TODO
- `infix`: An optional string appended directly to the 'That's an X' string, between the name the end of the sentence.
- `suffix`: An optional string appended in a separate sentence after the initial introduction line.
- Return: `TRUE` when the call chain is valid, otherwise `FALSE`
- Events: `atom_examined`
*/
/atom/proc/examine(mob/user, distance, infix = "", suffix = "")
SHOULD_CALL_PARENT(TRUE)
//This reformat names to get a/an properly working on item descriptions when they are bloody
var/f_name = "\a [src][infix]."
if(blood_color && !istype(src, /obj/effect/decal))
if(gender == PLURAL)
f_name = "some "
else
f_name = "a "
f_name += "<font color ='[blood_color]'>stained</font> [name][infix]!"
//This reformats names to get a/an properly working on item descriptions when they are bloody or coated in reagents.
var/examine_prefix = get_examine_prefix()
if(examine_prefix)
examine_prefix += " " // add a space to the end to be polite
var/composed_name = ADD_ARTICLE_GENDER("[examine_prefix][name]", gender)

to_chat(user, "[html_icon(src)] That's [f_name] [suffix]")
to_chat(user, "[html_icon(src)] That's [composed_name][infix][get_examine_punctuation()] [suffix]")
to_chat(user, desc)

var/list/alt_interactions = get_alt_interactions(user)
Expand Down Expand Up @@ -1010,3 +1007,14 @@
/atom/proc/immune_to_floor_hazards()
return !simulated

/// The punctuation used for the "That's an X." string.
/atom/proc/get_examine_punctuation()
// Could theoretically check if reagents in a coating are 'dangerous' or 'suspicious' (blood, acid, etc)
// in an override, but that'd require setting such a var on a bunch of materials and I'm lazy.
return blood_color ? "!" : "."

/// The prefix that goes before the atom name on examine.
/atom/proc/get_examine_prefix()
if(blood_color)
return FONT_COLORED(blood_color, "stained")
return null
3 changes: 3 additions & 0 deletions code/game/objects/effects/decals/decal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

/obj/effect/decal/lava_act()
. = !throwing ? ..() : FALSE

/obj/effect/decal/get_examine_prefix()
return null
30 changes: 23 additions & 7 deletions code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,13 @@
if(drying_wetness > 0 && drying_wetness != initial(drying_wetness))
desc_comp += "\The [src] is [get_dryness_text()]."

if(coating?.total_volume)
desc_comp += "It is covered in [coating.get_coated_name()]." // It is covered in dilute oily slimy bloody mud.

if(check_rights(R_DEBUG, 0, user))
to_chat(user, "\The [src] has a temperature of [temperature]K.")


return ..(user, distance, "", jointext(desc_comp, "<br/>"))

/obj/item/check_mousedrop_adjacency(var/atom/over, var/mob/user)
Expand Down Expand Up @@ -946,13 +950,10 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
return 0 // Process Kill

/obj/item/proc/get_examine_name()
. = name
if(coating?.total_volume)
. = SPAN_WARNING("<font color='[coating.get_color()]'>stained</font> [.]")
if(gender == PLURAL)
. = "some [.]"
else
. = "\a [.]"
var/examine_prefix = get_examine_prefix()
if(examine_prefix)
examine_prefix += " "
return ADD_ARTICLE_GENDER("[examine_prefix][name]", gender)

/obj/item/proc/get_examine_line()
. = "[html_icon(src)] [get_examine_name()]"
Expand Down Expand Up @@ -1060,6 +1061,13 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
if(coating.total_volume <= MINIMUM_CHEMICAL_VOLUME)
clean(FALSE)

/obj/item/proc/transfer_coating_to(atom/target, amount = 1, multiplier = 1, copy = 0, defer_update = FALSE, transferred_phases = (MAT_PHASE_LIQUID | MAT_PHASE_SOLID))
if(!coating)
return
coating.trans_to(target, amount, multiplier)
if(coating.total_volume <= MINIMUM_CHEMICAL_VOLUME)
clean(FALSE)

/obj/item/clean(clean_forensics=TRUE)
. = ..()
QDEL_NULL(coating)
Expand Down Expand Up @@ -1304,3 +1312,11 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.

/obj/item/proc/get_provided_intents(mob/wielder)
return null

/obj/item/get_examine_prefix()
if(coating?.total_volume)
var/coating_string = coating.get_coated_adjectives() // component coloring is handled in here
if(get_config_value(/decl/config/enum/colored_coating_names) == CONFIG_COATING_COLOR_MIXTURE)
coating_string = FONT_COLORED(coating.get_color(), coating_string)
return coating_string
return ..()
Loading

0 comments on commit 0775a3a

Please sign in to comment.