[MIRROR] Soap & clean proc refactor (#10989)

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-06-02 10:18:12 -07:00
committed by GitHub
parent 6badc27205
commit 4558eaab04
39 changed files with 465 additions and 327 deletions

View File

@@ -0,0 +1,24 @@
// Cleaning flags
// Different kinds of things that can be cleaned.
// Use these when overriding the wash proc or registering for the clean signals to check if your thing should be cleaned
#define CLEAN_TYPE_BLOOD (1 << 0)
#define CLEAN_TYPE_RUNES (1 << 1)
#define CLEAN_TYPE_FINGERPRINTS (1 << 2)
#define CLEAN_TYPE_BELLY (1 << 3) // Belly contaminants
#define CLEAN_TYPE_FIBERS (1 << 4)
#define CLEAN_TYPE_RADIATION (1 << 5)
#define CLEAN_TYPE_DISEASE (1 << 6)
#define CLEAN_TYPE_WEAK (1 << 7) // Special type, add this flag to make some cleaning processes non-instant.
#define CLEAN_TYPE_PAINT (1 << 8)
/// Cleans decals such as dirt and oil off the floor
#define CLEAN_TYPE_LIGHT_DECAL (1 << 9)
/// Cleans decals such as cobwebs off the floor
#define CLEAN_TYPE_HARD_DECAL (1 << 10)
// Different cleaning methods.
// Use these when calling the wash proc for your cleaning apparatus
#define CLEAN_WASH (CLEAN_TYPE_BLOOD | CLEAN_TYPE_RUNES | CLEAN_TYPE_DISEASE | CLEAN_TYPE_LIGHT_DECAL | CLEAN_TYPE_BELLY)
#define CLEAN_SCRUB (CLEAN_WASH | CLEAN_TYPE_FINGERPRINTS | CLEAN_TYPE_FIBERS | CLEAN_TYPE_PAINT | CLEAN_TYPE_HARD_DECAL)
#define CLEAN_RAD CLEAN_TYPE_RADIATION
#define CLEAN_ALL (ALL & ~CLEAN_TYPE_WEAK)

View File

@@ -615,8 +615,6 @@
#define COMSIG_TURF_IS_WET "check_turf_wet"
///(max_strength, immediate, duration_decrease = INFINITY): Returns bool.
#define COMSIG_TURF_MAKE_DRY "make_turf_try"
///called on an object to clean it of cleanables. Usualy with soap: (num/strength)
#define COMSIG_COMPONENT_CLEAN_ACT "clean_act"
//Creamed

View File

@@ -0,0 +1,2 @@
///Called on an object to "clean it", such as removing blood decals/overlays, etc. The clean types bitfield is sent with it. Return TRUE if any cleaning was necessary and thus performed.
#define COMSIG_COMPONENT_CLEAN_ACT "clean_act"

View File

@@ -83,3 +83,5 @@ GLOBAL_VAR_INIT(magic_appearance_detecting_image, new /image) // appearances are
/// NaN isn't a number, damn it. Infinity is a problem too.
#define isnum_safe(x) ( isnum((x)) && !isnan((x)) && !isinf((x)) )
#define ismopable(A) (A && (A.layer <= ABOVE_JUNK_LAYER)) //If something can be cleaned by floor-cleaning devices such as mops or clean bots