Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhials committed Feb 23, 2024
2 parents 8c878f5 + 9623817 commit 314494d
Show file tree
Hide file tree
Showing 40 changed files with 191 additions and 132 deletions.
5 changes: 5 additions & 0 deletions code/__DEFINES/cleaning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@
#define CLEAN_SCRUB (CLEAN_WASH | CLEAN_TYPE_FINGERPRINTS | CLEAN_TYPE_FIBERS | CLEAN_TYPE_HARD_DECAL)
#define CLEAN_RAD CLEAN_TYPE_RADIATION
#define CLEAN_ALL ALL

// Footprint sprites to use when making footprints in blood, oil, etc.
#define FOOTPRINT_SPRITE_SHOES "shoes"
#define FOOTPRINT_SPRITE_PAWS "paws"
#define FOOTPRINT_SPRITE_CLAWS "claws"
1 change: 1 addition & 0 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
#define JOB_BARTENDER "Bartender"
#define JOB_BOTANIST "Botanist"
#define JOB_COOK "Cook"
#define JOB_CHEF "Chef" // Alternate cook title.
#define JOB_JANITOR "Janitor"
#define JOB_CLOWN "Clown"
#define JOB_MIME "Mime"
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
#define SPECIES_NIGHTMARE "nightmare"
#define SPECIES_MONKEY "monkey"
#define SPECIES_MONKEY_FREAK "monkey_freak"
#define SPECIES_MONKEY_HOLODECK "monkey_holodeck"
#define SPECIES_MONKEY_HUMAN_LEGGED "monkey_human_legged"
#define SPECIES_MOTH "moth"
#define SPECIES_MUSHROOM "mush"
Expand Down
19 changes: 11 additions & 8 deletions code/datums/components/bloodysoles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/// The world.time when we last picked up blood
var/last_pickup

var/footprint_sprite = FOOTPRINT_SPRITE_SHOES

/datum/component/bloodysoles/Initialize()
if(!isclothing(parent))
return COMPONENT_INCOMPATIBLE
Expand Down Expand Up @@ -113,9 +115,9 @@
/**
* Find a blood decal on a turf that matches our last_blood_state
*/
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null)
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null, footprint_sprite)
for(var/obj/effect/decal/cleanable/blood/pool in turfLoc)
if(pool.blood_state == last_blood_state && (!typeFilter || istype(pool, typeFilter)))
if(pool.blood_state == last_blood_state && pool.footprint_sprite == footprint_sprite && (!typeFilter || istype(pool, typeFilter)))
return pool

/**
Expand Down Expand Up @@ -171,23 +173,23 @@
return

var/half_our_blood = bloody_shoes[last_blood_state] / 2

var/footprint_sprite = wielder.get_footprint_sprite()
// Add footprints in old loc if we have enough cream
if(half_our_blood >= BLOOD_FOOTPRINTS_MIN)
var/turf/oldLocTurf = get_turf(OldLoc)
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints)
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints, footprint_sprite)
if(oldLocFP)
// Footprints found in the tile we left, add us to it
add_parent_to_footprint(oldLocFP)
if (!(oldLocFP.exited_dirs & wielder.dir))
oldLocFP.exited_dirs |= wielder.dir
oldLocFP.update_appearance()
else if(find_pool_by_blood_state(oldLocTurf))
else if(find_pool_by_blood_state(oldLocTurf, footprint_sprite = footprint_sprite))
// No footprints in the tile we left, but there was some other blood pool there. Add exit footprints on it
adjust_bloody_shoes(last_blood_state, half_our_blood)
update_icon()

oldLocFP = new(oldLocTurf)
oldLocFP = new(oldLocTurf, footprint_sprite)
if(!QDELETED(oldLocFP)) ///prints merged
oldLocFP.blood_state = last_blood_state
oldLocFP.exited_dirs |= wielder.dir
Expand All @@ -207,7 +209,7 @@
adjust_bloody_shoes(last_blood_state, half_our_blood)
update_icon()

var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom))
var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom), footprint_sprite)
if(!QDELETED(FP)) ///prints merged
FP.blood_state = last_blood_state
FP.entered_dirs |= wielder.dir
Expand Down Expand Up @@ -266,7 +268,8 @@
return COMPONENT_INCOMPATIBLE
parent_atom = parent
wielder = parent

if(footprint_sprite)
src.footprint_sprite = footprint_sprite
if(!bloody_feet)
bloody_feet = mutable_appearance('icons/effects/blood.dmi', "shoeblood", SHOES_LAYER)

Expand Down
6 changes: 6 additions & 0 deletions code/datums/components/butchering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@
var/final_effectiveness = effectiveness - target.butcher_difficulty
var/bonus_chance = max(0, (final_effectiveness - 100) + bonus_modifier) //so 125 total effectiveness = 25% extra chance

if(target.flags_1 & HOLOGRAM_1)
butcher.visible_message(span_notice("[butcher] tries to butcher [target], but it vanishes."), \
span_notice("You try to butcher [target], but it vanishes."))
qdel(target)
return

for(var/result_typepath in target.butcher_results)
var/obj/remains = result_typepath
var/amount = target.butcher_results[remains]
Expand Down
25 changes: 8 additions & 17 deletions code/datums/elements/decals/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,20 @@

/datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _plane, _layer, _color, _alpha, _smoothing, source)
var/obj/item/I = source
if(!_icon)
_icon = 'icons/effects/blood.dmi'
if(!_icon_state)
_icon_state = "itemblood"
var/icon = I.icon
var/icon_state = I.icon_state
if(!icon || !icon_state)
// It's something which takes on the look of other items, probably
icon = I.icon
icon_state = I.icon_state
var/static/list/blood_splatter_appearances = list()
//try to find a pre-processed blood-splatter. otherwise, make a new one
var/index = "[REF(icon)]-[icon_state]"
pic = blood_splatter_appearances[index]

if(!pic)
var/icon/blood_splatter_icon = icon(I.icon, I.icon_state, , 1) //icon of the item that will become splattered
var/icon/blood_icon = icon(_icon, _icon_state) //icon of the blood that we apply
blood_icon.Scale(blood_splatter_icon.Width(), blood_splatter_icon.Height())
blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent)
blood_splatter_icon.Blend(blood_icon, ICON_MULTIPLY) //adds blood and the remaining white areas become transparant
pic = mutable_appearance(blood_splatter_icon, I.icon_state)
blood_splatter_appearances[index] = pic
var/icon/icon_for_size = icon(icon, icon_state)
var/scale_factor_x = icon_for_size.Width()/world.icon_size
var/scale_factor_y = icon_for_size.Height()/world.icon_size
var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = RESET_COLOR) //MA of the blood that we apply
blood_splatter.transform = blood_splatter.transform.Scale(scale_factor_x, scale_factor_y)
blood_splatter.blend_mode = BLEND_INSET_OVERLAY
blood_splatter.color = _color
pic = blood_splatter
return TRUE

/datum/element/decal/blood/proc/get_examine_name(datum/source, mob/user, list/override)
Expand Down
19 changes: 10 additions & 9 deletions code/game/machinery/computer/crew.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new)
// 60+: Service
JOB_HEAD_OF_PERSONNEL = 60,
JOB_BARTENDER = 61,
JOB_COOK = 62,
JOB_BOTANIST = 63,
JOB_CURATOR = 64,
JOB_CHAPLAIN = 65,
JOB_CLOWN = 66,
JOB_MIME = 67,
JOB_JANITOR = 68,
JOB_LAWYER = 69,
JOB_PSYCHOLOGIST = 71,
JOB_CHEF = 62,
JOB_COOK = 63,
JOB_BOTANIST = 64,
JOB_CURATOR = 65,
JOB_CHAPLAIN = 66,
JOB_CLOWN = 67,
JOB_MIME = 68,
JOB_JANITOR = 69,
JOB_LAWYER = 71,
JOB_PSYCHOLOGIST = 72,
// 200-229: Centcom
JOB_CENTCOM_ADMIRAL = 200,
JOB_CENTCOM = 201,
Expand Down
39 changes: 28 additions & 11 deletions code/game/objects/effects/decals/cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var/dryname = "dried blood" //when the blood lasts long enough, it becomes dry and gets a new name
var/drydesc = "Looks like it's been here a while. Eew." //as above
var/drytime = 0
var/footprint_sprite = null

/obj/effect/decal/cleanable/blood/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -230,7 +231,7 @@
name = "footprints"
desc = "WHOSE FOOTPRINTS ARE THESE?"
icon = 'icons/effects/footprints.dmi'
icon_state = "blood1"
icon_state = "blood_shoes_enter"
random_icon_states = null
blood_state = BLOOD_STATE_HUMAN //the icon state to load images from
var/entered_dirs = 0
Expand All @@ -245,12 +246,13 @@
dryname = "dried footprints"
drydesc = "HMM... SOMEONE WAS HERE!"

/obj/effect/decal/cleanable/blood/footprints/Initialize(mapload)
/obj/effect/decal/cleanable/blood/footprints/Initialize(mapload, footprint_sprite)
src.footprint_sprite = footprint_sprite
. = ..()
icon_state = "" //All of the footprint visuals come from overlays
if(mapload)
entered_dirs |= dir //Keep the same appearance as in the map editor
update_appearance()
update_appearance(mapload ? (ALL) : (UPDATE_NAME | UPDATE_DESC))

//Rotate all of the footprint directions too
/obj/effect/decal/cleanable/blood/footprints/setDir(newdir)
Expand All @@ -272,6 +274,21 @@
update_appearance()
return ..()

/obj/effect/decal/cleanable/blood/footprints/update_name(updates)
switch(footprint_sprite)
if(FOOTPRINT_SPRITE_CLAWS)
name = "clawprints"
if(FOOTPRINT_SPRITE_SHOES)
name = "footprints"
if(FOOTPRINT_SPRITE_PAWS)
name = "pawprints"
dryname = "dried [name]"
return ..()

/obj/effect/decal/cleanable/blood/footprints/update_desc(updates)
desc = "WHOSE [uppertext(name)] ARE THESE?"
return ..()

/obj/effect/decal/cleanable/blood/footprints/update_icon()
. = ..()
alpha = min(BLOODY_FOOTPRINT_BASE_ALPHA + (255 - BLOODY_FOOTPRINT_BASE_ALPHA) * bloodiness / (BLOOD_ITEM_MAX / 2), 255)
Expand All @@ -286,22 +303,22 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
. = ..()
for(var/Ddir in GLOB.cardinals)
if(entered_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"]
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[footprint_sprite]-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]1", dir = Ddir)
GLOB.bloody_footprints_cache["entered-[footprint_sprite]-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]_[footprint_sprite]_enter", dir = Ddir)
. += bloodstep_overlay

if(exited_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"]
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[footprint_sprite]-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]2", dir = Ddir)
GLOB.bloody_footprints_cache["exited-[footprint_sprite]-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]_[footprint_sprite]_exit", dir = Ddir)
. += bloodstep_overlay


/obj/effect/decal/cleanable/blood/footprints/examine(mob/user)
. = ..()
if((shoe_types.len + species_types.len) > 0)
. += "You recognise the footprints as belonging to:"
. += "You recognise the [name] as belonging to:"
for(var/sole in shoe_types)
var/obj/item/clothing/item = sole
var/article = initial(item.gender) == PLURAL ? "Some" : "A"
Expand All @@ -311,14 +328,14 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
if(species == "unknown")
. += "Some <B>feet</B>."
else if(species == SPECIES_MONKEY)
. += "[icon2html('icons/mob/human/human.dmi', user, "monkey")] Some <B>monkey feet</B>."
. += "[icon2html('icons/mob/human/human.dmi', user, "monkey")] Some <B>monkey paws</B>."
else if(species == SPECIES_HUMAN)
. += "[icon2html('icons/mob/human/bodyparts.dmi', user, "default_human_l_leg")] Some <B>human feet</B>."
else
. += "[icon2html('icons/mob/human/bodyparts.dmi', user, "[species]_l_leg")] Some <B>[species] feet</B>."

/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/C)
if(blood_state != C.blood_state) //We only replace footprints of the same type as us
/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/blood/blood_decal)
if(blood_state != blood_decal.blood_state || footprint_sprite != blood_decal.footprint_sprite) //We only replace footprints of the same type as us
return FALSE
return ..()

Expand Down
5 changes: 2 additions & 3 deletions code/game/objects/effects/spawners/random/entertainment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@
loot = list(
/obj/item/coin/iron = 5,
/obj/item/coin/plastic = 5,
/obj/item/coin/silver = 3,
/obj/item/coin/plasma = 3,
/obj/item/coin/silver = 4,
/obj/item/coin/plasma = 4,
/obj/item/coin/uranium = 3,
/obj/item/coin/titanium = 3,
/obj/item/coin/diamond = 2,
/obj/item/coin/bananium = 2,
/obj/item/coin/adamantine = 2,
/obj/item/coin/mythril = 2,
/obj/item/coin/runite = 2,
/obj/item/food/chococoin = 2,
/obj/item/coin/twoheaded = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
if(ears.damage)
render_list += "<span class='alert ml-2'>Subject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.\n</span>"
if(ears.deaf)
render_list += "<span class='alert ml-2'>Subject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.\n</span>"
render_list += "<span class='alert ml-2'>Subject is [ears.damage > ears.maxHealth ? "permanently": "temporarily"] deaf.\n</span>"

// Eye status
var/obj/item/organ/internal/eyes/eyes = carbontarget.get_organ_slot(ORGAN_SLOT_EYES)
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/structures/maintenance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ at the cost of risking a vicious bite.**/
/obj/item/restraints/handcuffs/cable/green = 1,
/obj/item/restraints/handcuffs/cable/pink = 1,
/obj/item/restraints/handcuffs/alien = 2,
/obj/item/coin/bananium = 9,
/obj/item/coin/bananium = 10,
/obj/item/knife/butcher = 5,
/obj/item/coin/mythril = 1,
)


Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/shoes/_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
var/lace_time = 5 SECONDS
///An active alert
var/datum/weakref/our_alert_ref
var/footprint_sprite = FOOTPRINT_SPRITE_SHOES

/datum/armor/clothing_shoes
bio = 50
Expand Down
4 changes: 2 additions & 2 deletions code/modules/fishing/sources/source_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@
/obj/item/stack/ore/plasma = 3,
/mob/living/basic/mining/lobstrosity = 1,
/obj/effect/decal/remains/plasma = 1,
/obj/item/stack/sheet/mineral/mythril = 1,
/obj/item/stack/sheet/mineral/runite = 1,
/obj/item/stack/sheet/mineral/adamantine = 1,
)
fish_counts = list(
/obj/item/stack/sheet/mineral/adamantine = 3,
/obj/item/stack/sheet/mineral/mythril = 2,
/obj/item/stack/sheet/mineral/runite = 2,
)

/datum/fish_source/moisture_trap
Expand Down
6 changes: 6 additions & 0 deletions code/modules/food_and_drinks/machinery/gibber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
if(!occupant)
audible_message(span_hear("You hear a loud metallic grinding sound."))
return
if(occupant.flags_1 & HOLOGRAM_1)
audible_message(span_hear("You hear a very short metallic grinding sound."))
playsound(loc, 'sound/machines/hiss.ogg', 20, TRUE)
qdel(occupant)
set_occupant(null)
return

use_power(active_power_usage)
audible_message(span_hear("You hear a loud squelchy grinding sound."))
Expand Down
17 changes: 13 additions & 4 deletions code/modules/forensics/_forensics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
var/atom/parent_atom = parent.resolve()
if (!isnull(parent_atom))
UnregisterSignal(parent_atom, list(COMSIG_COMPONENT_CLEAN_ACT))
parent = null
return ..()

/// Empties the fingerprints list
Expand Down Expand Up @@ -147,7 +148,9 @@
/// Adds a single fiber
/datum/forensics/proc/add_fibers(mob/living/carbon/human/suspect)
var/fibertext
var/atom/actual_parent = parent.resolve()
var/atom/actual_parent = parent?.resolve()
if(isnull(actual_parent))
parent = null
var/item_multiplier = isitem(actual_parent) ? ITEM_FIBER_MULTIPLIER : NON_ITEM_FIBER_MULTIPLIER
if(suspect.wear_suit)
fibertext = "Material from \a [suspect.wear_suit]."
Expand Down Expand Up @@ -214,8 +217,11 @@
if(last_stamp_pos)
LAZYSET(hiddenprints, suspect.key, copytext(hiddenprints[suspect.key], 1, last_stamp_pos))
hiddenprints[suspect.key] += "\nLast: \[[current_time]\] \"[suspect.real_name]\"[has_gloves]. Ckey: [suspect.ckey]" //made sure to be existing by if(!LAZYACCESS);else
var/atom/parent_atom = parent.resolve()
parent_atom.fingerprintslast = suspect.ckey
var/atom/parent_atom = parent?.resolve()
if(!isnull(parent_atom))
parent_atom.fingerprintslast = suspect.ckey
else
parent = null
return TRUE

/// Adds the given list into blood_DNA
Expand All @@ -230,7 +236,10 @@

/// Updates the blood displayed on parent
/datum/forensics/proc/check_blood()
var/obj/item/the_thing = parent.resolve()
var/obj/item/the_thing = parent?.resolve()
if(isnull(the_thing))
parent = null
return
if(!istype(the_thing) || isorgan(the_thing)) // organs don't spawn with blood decals by default
return
if(!length(blood_DNA))
Expand Down
Loading

0 comments on commit 314494d

Please sign in to comment.