diff --git a/code/__defines/flags.dm b/code/__defines/flags.dm index 6fd546b651e..030138bd1da 100644 --- a/code/__defines/flags.dm +++ b/code/__defines/flags.dm @@ -1,11 +1,11 @@ -#define CLOSET_HAS_LOCK 1 -#define CLOSET_CAN_BE_WELDED 2 +#define CLOSET_HAS_LOCK BITFLAG(0) +#define CLOSET_CAN_BE_WELDED BITFLAG(1) -#define CLOSET_STORAGE_MISC 1 -#define CLOSET_STORAGE_ITEMS 2 -#define CLOSET_STORAGE_MOBS 4 -#define CLOSET_STORAGE_STRUCTURES 8 -#define CLOSET_STORAGE_ALL (~0) +#define CLOSET_STORAGE_MISC BITFLAG(0) +#define CLOSET_STORAGE_ITEMS BITFLAG(1) +#define CLOSET_STORAGE_MOBS BITFLAG(2) +#define CLOSET_STORAGE_STRUCTURES BITFLAG(3) +#define CLOSET_STORAGE_ALL (~0) /* Bitflags for flag variables. These are used instead of separate boolean vars to reduce the overall number of variables, @@ -34,72 +34,72 @@ The latter will result in a linter warning and will not work correctly. */ // Atom-level flags (/atom/var/atom_flags) -#define ATOM_FLAG_CHECKS_BORDER BITFLAG(0) // If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes -#define ATOM_FLAG_CLIMBABLE BITFLAG(1) // This object can be climbed on -#define ATOM_FLAG_NO_BLOOD BITFLAG(2) // Used for items if they don't want to get a blood overlay. -#define ATOM_FLAG_NO_REACT BITFLAG(3) // Reagents don't react inside this container. -#define ATOM_FLAG_OPEN_CONTAINER BITFLAG(4) // Is an open container for chemistry purposes. -#define ATOM_FLAG_INITIALIZED BITFLAG(5) // Has this atom been initialized -#define ATOM_FLAG_NO_TEMP_CHANGE BITFLAG(6) // Reagents do not cool or heat to ambient temperature in this container. -#define ATOM_FLAG_CAN_BE_PAINTED BITFLAG(7) // Can be painted using a paint sprayer or similar. -#define ATOM_FLAG_SHIELD_CONTENTS BITFLAG(8) // Protects contents from some global effects (Solar storms) -#define ATOM_FLAG_ADJACENT_EXCEPTION BITFLAG(9) // Skips adjacent checks for atoms that should always be reachable in window tiles -#define ATOM_FLAG_NO_DISSOLVE BITFLAG(10) // Bypasses solvent reactions in the container. -#define ATOM_FLAG_NO_PHASE_CHANGE BITFLAG(11) // Bypasses heating and cooling product reactions in the container. -#define ATOM_FLAG_BLOCK_DIAGONAL_FACING BITFLAG(12) // Atom cannot face non-cardinal directions. +#define ATOM_FLAG_CHECKS_BORDER BITFLAG(0) // If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes +#define ATOM_FLAG_CLIMBABLE BITFLAG(1) // This object can be climbed on +#define ATOM_FLAG_NO_BLOOD BITFLAG(2) // Used for items if they don't want to get a blood overlay. +#define ATOM_FLAG_NO_REACT BITFLAG(3) // Reagents don't react inside this container. +#define ATOM_FLAG_OPEN_CONTAINER BITFLAG(4) // Is an open container for chemistry purposes. +#define ATOM_FLAG_INITIALIZED BITFLAG(5) // Has this atom been initialized +#define ATOM_FLAG_NO_TEMP_CHANGE BITFLAG(6) // Reagents do not cool or heat to ambient temperature in this container. +#define ATOM_FLAG_CAN_BE_PAINTED BITFLAG(7) // Can be painted using a paint sprayer or similar. +#define ATOM_FLAG_SHIELD_CONTENTS BITFLAG(8) // Protects contents from some global effects (Solar storms) +#define ATOM_FLAG_ADJACENT_EXCEPTION BITFLAG(9) // Skips adjacent checks for atoms that should always be reachable in window tiles +#define ATOM_FLAG_NO_DISSOLVE BITFLAG(10) // Bypasses solvent reactions in the container. +#define ATOM_FLAG_NO_PHASE_CHANGE BITFLAG(11) // Bypasses heating and cooling product reactions in the container. +#define ATOM_FLAG_BLOCK_DIAGONAL_FACING BITFLAG(12) // Atom cannot face non-cardinal directions. -#define ATOM_FLAG_NO_CHEM_CHANGE (ATOM_FLAG_NO_REACT | ATOM_FLAG_NO_DISSOLVE | ATOM_FLAG_NO_PHASE_CHANGE) +#define ATOM_FLAG_NO_CHEM_CHANGE (ATOM_FLAG_NO_REACT | ATOM_FLAG_NO_DISSOLVE | ATOM_FLAG_NO_PHASE_CHANGE) -#define ATOM_IS_OPEN_CONTAINER(A) (A.atom_flags & ATOM_FLAG_OPEN_CONTAINER) +#define ATOM_IS_OPEN_CONTAINER(A) (A.atom_flags & ATOM_FLAG_OPEN_CONTAINER) // Movable-level flags (/atom/movable/movable_flags) -#define MOVABLE_FLAG_PROXMOVE BITFLAG(0) // Does this object require proximity checking in Enter()? -#define MOVABLE_FLAG_Z_INTERACT BITFLAG(1) // Should attackby and attack_hand be relayed through ladders and open spaces? -#define MOVABLE_FLAG_ALWAYS_SHUTTLEMOVE BITFLAG(2) // Is this an effect that should move? -#define MOVABLE_FLAG_DEL_SHUTTLE BITFLAG(3) // Shuttle transistion will delete this. -#define MOVABLE_FLAG_WHEELED BITFLAG(4) // Movable has reduced stamina cost/speed reduction when pulled. +#define MOVABLE_FLAG_PROXMOVE BITFLAG(0) // Does this object require proximity checking in Enter()? +#define MOVABLE_FLAG_Z_INTERACT BITFLAG(1) // Should attackby and attack_hand be relayed through ladders and open spaces? +#define MOVABLE_FLAG_ALWAYS_SHUTTLEMOVE BITFLAG(2) // Is this an effect that should move? +#define MOVABLE_FLAG_DEL_SHUTTLE BITFLAG(3) // Shuttle transistion will delete this. +#define MOVABLE_FLAG_WHEELED BITFLAG(4) // Movable has reduced stamina cost/speed reduction when pulled. // Object-level flags (/obj/obj_flags) -#define OBJ_FLAG_ANCHORABLE BITFLAG(0) // This object can be stuck in place with a tool -#define OBJ_FLAG_CONDUCTIBLE BITFLAG(1) // Conducts electricity. (metal etc.) -#define OBJ_FLAG_ROTATABLE BITFLAG(2) // Can be rotated with alt-click -#define OBJ_FLAG_NOFALL BITFLAG(3) // Will prevent mobs from falling -#define OBJ_FLAG_MOVES_UNSUPPORTED BITFLAG(4) // Object moves with shuttle transition even if turf below is a background turf. -#define OBJ_FLAG_HOLLOW BITFLAG(5) // Modifies initial matter values to be lower than w_class normally sets. +#define OBJ_FLAG_ANCHORABLE BITFLAG(0) // This object can be stuck in place with a tool +#define OBJ_FLAG_CONDUCTIBLE BITFLAG(1) // Conducts electricity. (metal etc.) +#define OBJ_FLAG_ROTATABLE BITFLAG(2) // Can be rotated with alt-click +#define OBJ_FLAG_NOFALL BITFLAG(3) // Will prevent mobs from falling +#define OBJ_FLAG_MOVES_UNSUPPORTED BITFLAG(4) // Object moves with shuttle transition even if turf below is a background turf. +#define OBJ_FLAG_HOLLOW BITFLAG(5) // Modifies initial matter values to be lower than w_class normally sets. // Item-level flags (/obj/item/item_flags) -#define ITEM_FLAG_NO_BLUDGEON BITFLAG(0) // When an item has this it produces no "X has been hit by Y with Z" message with the default handler. -#define ITEM_FLAG_NO_CONTAMINATION BITFLAG(1) // Does not get contaminated. -#define ITEM_FLAG_NO_PRINT BITFLAG(2) // This object does not leave the user's prints/fibres when using it -#define ITEM_FLAG_INVALID_FOR_CHAMELEON BITFLAG(3) // Chameleon items cannot mimick this. -#define ITEM_FLAG_THICKMATERIAL BITFLAG(4) // Prevents syringes, reagent pens, and hyposprays if equiped to slot_suit or slot_head_str. -#define ITEM_FLAG_AIRTIGHT BITFLAG(5) // Functions with internals. -#define ITEM_FLAG_NOSLIP BITFLAG(6) // Prevents from slipping on wet floors, in space, etc. -#define ITEM_FLAG_BLOCK_GAS_SMOKE_EFFECT BITFLAG(7) // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL) -#define ITEM_FLAG_FLEXIBLEMATERIAL BITFLAG(8) // At the moment, masks with this flag will not prevent eating even if they are covering your face. -#define ITEM_FLAG_IS_BELT BITFLAG(9) // Items that can be worn on the belt slot, even with no undersuit equipped -#define ITEM_FLAG_SILENT BITFLAG(10) // sneaky shoes -#define ITEM_FLAG_NOCUFFS BITFLAG(11) // Gloves that have this flag prevent cuffs being applied -#define ITEM_FLAG_CAN_HIDE_IN_SHOES BITFLAG(12) // Items that can be hidden in shoes that permit it -#define ITEM_FLAG_PADDED BITFLAG(13) // When set on gloves, will act like pulling punches in unarmed combat. -#define ITEM_FLAG_CAN_TAPE BITFLAG(14) //Whether the item can be be taped onto something using tape +#define ITEM_FLAG_NO_BLUDGEON BITFLAG(0) // When an item has this it produces no "X has been hit by Y with Z" message with the default handler. +#define ITEM_FLAG_NO_CONTAMINATION BITFLAG(1) // Does not get contaminated. +#define ITEM_FLAG_NO_PRINT BITFLAG(2) // This object does not leave the user's prints/fibres when using it +#define ITEM_FLAG_INVALID_FOR_CHAMELEON BITFLAG(3) // Chameleon items cannot mimick this. +#define ITEM_FLAG_THICKMATERIAL BITFLAG(4) // Prevents syringes, reagent pens, and hyposprays if equiped to slot_suit or slot_head_str. +#define ITEM_FLAG_AIRTIGHT BITFLAG(5) // Functions with internals. +#define ITEM_FLAG_NOSLIP BITFLAG(6) // Prevents from slipping on wet floors, in space, etc. +#define ITEM_FLAG_BLOCK_GAS_SMOKE_EFFECT BITFLAG(7) // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL) +#define ITEM_FLAG_FLEXIBLEMATERIAL BITFLAG(8) // At the moment, masks with this flag will not prevent eating even if they are covering your face. +#define ITEM_FLAG_IS_BELT BITFLAG(9) // Items that can be worn on the belt slot, even with no undersuit equipped +#define ITEM_FLAG_SILENT BITFLAG(10) // sneaky shoes +#define ITEM_FLAG_NOCUFFS BITFLAG(11) // Gloves that have this flag prevent cuffs being applied +#define ITEM_FLAG_CAN_HIDE_IN_SHOES BITFLAG(12) // Items that can be hidden in shoes that permit it +#define ITEM_FLAG_PADDED BITFLAG(13) // When set on gloves, will act like pulling punches in unarmed combat. +#define ITEM_FLAG_CAN_TAPE BITFLAG(14) // Whether the item can be be taped onto something using tape // Flags for pass_flags (/atom/var/pass_flags) -#define PASS_FLAG_TABLE BITFLAG(0) -#define PASS_FLAG_GLASS BITFLAG(1) -#define PASS_FLAG_GRILLE BITFLAG(2) -#define PASS_FLAG_MOB BITFLAG(3) +#define PASS_FLAG_TABLE BITFLAG(0) +#define PASS_FLAG_GLASS BITFLAG(1) +#define PASS_FLAG_GRILLE BITFLAG(2) +#define PASS_FLAG_MOB BITFLAG(3) // Overmap sector flags (/obj/effect/overmap/visitable/var/sector_flags) -#define OVERMAP_SECTOR_BASE BITFLAG(0) // Whether or not this sector is a starting sector. Z levels contained in this sector are added to station_levels -#define OVERMAP_SECTOR_KNOWN BITFLAG(1) // Makes the sector show up on nav computers -#define OVERMAP_SECTOR_IN_SPACE BITFLAG(2) // If the sector can be accessed by drifting off the map edge -#define OVERMAP_SECTOR_UNTARGETABLE BITFLAG(3) // If the sector is untargetable by missiles. +#define OVERMAP_SECTOR_BASE BITFLAG(0) // Whether or not this sector is a starting sector. Z levels contained in this sector are added to station_levels +#define OVERMAP_SECTOR_KNOWN BITFLAG(1) // Makes the sector show up on nav computers +#define OVERMAP_SECTOR_IN_SPACE BITFLAG(2) // If the sector can be accessed by drifting off the map edge +#define OVERMAP_SECTOR_UNTARGETABLE BITFLAG(3) // If the sector is untargetable by missiles. // Flags for reagent presentation (/obj/item/chems/var/presentation_flags) -#define PRESENTATION_FLAG_NAME BITFLAG(0) // This chems subtype presents the name of its main reagent/cocktail. -#define PRESENTATION_FLAG_DESC BITFLAG(1) // This chems subtype presents the description of its main reagent/cocktail. +#define PRESENTATION_FLAG_NAME BITFLAG(0) // This chems subtype presents the name of its main reagent/cocktail. +#define PRESENTATION_FLAG_DESC BITFLAG(1) // This chems subtype presents the description of its main reagent/cocktail. // Decl-level flags (/decl/var/decl_flags) -#define DECL_FLAG_ALLOW_ABSTRACT_INIT BITFLAG(0) // Abstract subtypes without this set will CRASH() if fetched with GET_DECL(). -#define DECL_FLAG_MANDATORY_UID BITFLAG(1) // Requires uid to be non-null. \ No newline at end of file +#define DECL_FLAG_ALLOW_ABSTRACT_INIT BITFLAG(0) // Abstract subtypes without this set will CRASH() if fetched with GET_DECL(). +#define DECL_FLAG_MANDATORY_UID BITFLAG(1) // Requires uid to be non-null. \ No newline at end of file diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 4b6f71da04e..a5ca0d8a22c 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -316,4 +316,8 @@ #define EXCEPTION_TEXT(E) "'[E.name]' ('[E.type]'): '[E.file]':[E.line]:\n'[E.desc]'" #define LEVEL_BELOW_PLATING 1 -#define LEVEL_ABOVE_PLATING 2 \ No newline at end of file +#define LEVEL_ABOVE_PLATING 2 + +// Defines for fluorescence (/atom/var/fluorescent) +#define FLUORESCENT_GLOWS 1 // Glows when under flourescent light +#define FLUORESCENT_GLOWING 2 // Currently glowing due to flourescent light \ No newline at end of file diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 4e803429ba2..93a3b3bea42 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -27,8 +27,8 @@ var/was_bloodied /// (COLOR) The color of the blood shown on blood overlays. var/blood_color - /// (1 | 2 | 3) If it shows up under UV light. 0 doesn't, 1 does, 2 is currently glowing due to UV light. TODO: Use defines - var/fluorescent + /// (FALSE|DEFINES) How this atom is interacting with UV light. See misc.dm + var/fluorescent = FALSE /// (LIST) A list of all mobs that are climbing or currently on this atom @@ -471,7 +471,7 @@ SHOULD_CALL_PARENT(TRUE) if(!simulated) return - fluorescent = 0 + fluorescent = FALSE germ_level = 0 blood_color = null if(istype(blood_DNA, /list)) diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index f473ccc06f2..4de3c466f56 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -32,12 +32,12 @@ var/global/list/image/splatter_cache=list() /obj/effect/decal/cleanable/blood/reveal_blood() if(!fluorescent) - fluorescent = 1 + fluorescent = FLUORESCENT_GLOWS basecolor = COLOR_LUMINOL update_icon() /obj/effect/decal/cleanable/blood/clean_blood() - fluorescent = 0 + fluorescent = FALSE if(invisibility != INVISIBILITY_ABSTRACT) set_invisibility(INVISIBILITY_ABSTRACT) amount = 0 diff --git a/code/game/objects/item.dm b/code/game/objects/item.dm index 3ba0e0ab30f..178439526e0 100644 --- a/code/game/objects/item.dm +++ b/code/game/objects/item.dm @@ -562,7 +562,7 @@ /obj/item/reveal_blood() if(was_bloodied && !fluorescent) - fluorescent = 1 + fluorescent = FLUORESCENT_GLOWS blood_color = COLOR_LUMINOL blood_overlay.color = COLOR_LUMINOL update_icon() diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index 12dbb980ac6..b6c2a651303 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -51,17 +51,20 @@ if(scanned.len) for(var/atom/O in scanned) O.set_invisibility(scanned[O]) - if(O.fluorescent == 2) O.fluorescent = 1 + if(O.fluorescent == FLUORESCENT_GLOWING) + O.fluorescent = FLUORESCENT_GLOWS scanned.Cut() if(stored_alpha.len) for(var/atom/O in stored_alpha) O.alpha = stored_alpha[O] - if(O.fluorescent == 2) O.fluorescent = 1 + if(O.fluorescent == FLUORESCENT_GLOWING) + O.fluorescent = FLUORESCENT_GLOWS stored_alpha.Cut() if(reset_objects.len) for(var/obj/item/I in reset_objects) I.overlays -= I.blood_overlay - if(I.fluorescent == 2) I.fluorescent = 1 + if(I.fluorescent == FLUORESCENT_GLOWING) + I.fluorescent = FLUORESCENT_GLOWS reset_objects.Cut() /obj/item/uv_light/Process() @@ -74,8 +77,8 @@ for(var/turf/T in range(range, origin)) var/use_alpha = 255 - (step_alpha * get_dist(origin, T)) for(var/atom/A in T.contents) - if(A.fluorescent == 1) - A.fluorescent = 2 //To prevent light crosstalk. + if(A.fluorescent == FLUORESCENT_GLOWS) + A.fluorescent = FLUORESCENT_GLOWING //To prevent light crosstalk. if(A.invisibility) scanned[A] = A.invisibility A.set_invisibility(INVISIBILITY_NONE) diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 8b702bd9ff9..834456dd00c 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -301,7 +301,7 @@ splatter.basecolor = blood_data["blood_color"] splatter.update_icon() - splatter.fluorescent = 0 + splatter.fluorescent = FALSE splatter.set_invisibility(INVISIBILITY_NONE) return splatter