Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

[pull] master from Aurorastation:master #13

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions code/ZAS/Airflow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Contains helper procs for airflow, handled in /connection_group.

/mob/living/carbon/human/airflow_stun()
if(shoes)
if(shoes.item_flags & NOSLIP) return 0
if(shoes.item_flags & ITEM_FLAG_NO_SLIP) return 0
..()

/atom/movable/proc/check_airflow_movable(n)
Expand Down Expand Up @@ -74,7 +74,7 @@ Contains helper procs for airflow, handled in /connection_group.
if(buckled_to)
return 0
var/obj/item/shoes = get_equipped_item(slot_shoes)
if(istype(shoes) && (shoes.item_flags & NOSLIP))
if(istype(shoes) && (shoes.item_flags & ITEM_FLAG_NO_SLIP))
return 0
return 1

Expand Down
12 changes: 6 additions & 6 deletions code/ZAS/Phoron.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
/obj/var/contaminated = 0

/obj/item/proc/can_contaminate()
if(flags & PHORONGUARD)
if(item_flags & ITEM_FLAG_PHORON_GUARD)
return FALSE
return TRUE

Expand Down Expand Up @@ -99,15 +99,15 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
var/burn_eyes = 1

//Check for protective glasses
if(glasses && (glasses.body_parts_covered & EYES) && (glasses.item_flags & AIRTIGHT))
if(glasses && (glasses.body_parts_covered & EYES) && (glasses.item_flags & ITEM_FLAG_AIRTIGHT))
burn_eyes = 0

//Check for protective maskwear
if(burn_eyes && wear_mask && (wear_mask.body_parts_covered & EYES) && (wear_mask.item_flags & AIRTIGHT))
if(burn_eyes && wear_mask && (wear_mask.body_parts_covered & EYES) && (wear_mask.item_flags & ITEM_FLAG_AIRTIGHT))
burn_eyes = 0

//Check for protective helmets
if(burn_eyes && head && (head.body_parts_covered & EYES) && (head.item_flags & AIRTIGHT))
if(burn_eyes && head && (head.body_parts_covered & EYES) && (head.item_flags & ITEM_FLAG_AIRTIGHT))
burn_eyes = 0

//If we still need to, burn their eyes
Expand Down Expand Up @@ -141,7 +141,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
//Checks if the head is adequately sealed.
if(head)
if(vsc.plc.PHORONGUARD_ONLY)
if(head.flags & PHORONGUARD)
if(head.item_flags & ITEM_FLAG_PHORON_GUARD)
return 1
else if(head.body_parts_covered & EYES)
return 1
Expand All @@ -153,7 +153,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
for(var/obj/item/protection in list(wear_suit, gloves, shoes))
if(!protection)
continue
if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD))
if(vsc.plc.PHORONGUARD_ONLY && !(protection.item_flags & ITEM_FLAG_PHORON_GUARD))
return 0
coverage |= protection.body_parts_covered

Expand Down
70 changes: 66 additions & 4 deletions code/__defines/flags.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Movable flags.
#define MOVABLE_FLAG_EFFECTMOVE 1 //Is this an effect that should move?
#define MOVABLE_FLAG_DEL_SHUTTLE 2 //Shuttle transition will delete this.

var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)

#define TURF_IS_MIMICING(T) (isturf(T) && (T:z_flags & ZM_MIMIC_BELOW))
Expand All @@ -27,3 +23,69 @@ var/list/mimic_defines = list(
"ZM_MIMIC_NO_AO",
"ZM_NO_OCCLUDE"
)

// Flags bitmask

/// If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes
#define ATOM_FLAG_CHECKS_BORDER FLAG(1)
/// Used for atoms if they don't want to get a blood overlay.
#define ATOM_FLAG_NO_BLOOD FLAG(2)
/// Reagents do not react in this containers
#define ATOM_FLAG_NO_REACT FLAG(3)
/// Is an open container for chemistry purposes
#define ATOM_FLAG_OPEN_CONTAINER FLAG(4)
/// Reagent container that can pour its contents with a lid on. only used for syrup bottles for now
#define ATOM_FLAG_POUR_CONTAINER FLAG(5)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define ATOM_FLAG_HTML_USE_INITIAL_ICON FLAG(6)

// Movable flags.

/// Does this object require proximity checking in Enter()?
#define MOVABLE_FLAG_PROXMOVE FLAG(1)
///Is this an effect that should move?
#define MOVABLE_FLAG_EFFECTMOVE FLAG(2)
///Shuttle transition will delete this.
#define MOVABLE_FLAG_DEL_SHUTTLE FLAG(3)

// Obj flags

/// Can this object be rotated?
#define OBJ_FLAG_ROTATABLE FLAG(0)
/// This object can be rotated even while anchored
#define OBJ_FLAG_ROTATABLE_ANCHORED FLAG(1)
/// Can this take a signaler? only in use for machinery
#define OBJ_FLAG_SIGNALER FLAG(2)
/// Will prevent mobs from falling
#define OBJ_FLAG_NOFALL FLAG(3)
/// Object moves with shuttle transition even if turf below is a background turf.
#define OBJ_FLAG_MOVES_UNSUPPORTED FLAG(4)
#define OBJ_FLAG_CONDUCTABLE FLAG(5)

// Item flags
/// 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_BLUDGEON FLAG(0)
/// Does not get contaminated by phoron.
#define ITEM_FLAG_PHORON_GUARD FLAG(1)
/// Prevents syringes, parapens and hyposprays if equiped to slot_suit or slot_head.
#define ITEM_FLAG_THICK_MATERIAL FLAG(2)
/// Functions with internals
#define ITEM_FLAG_AIRTIGHT FLAG(3)
///Prevents from slipping on wet floors, in space, etc.
#define ITEM_FLAG_NO_SLIP FLAG(4)
/// Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
#define ITEM_FLAG_BLOCK_GAS_SMOKE_EFFECT FLAG(5)
/// At the moment, masks with this flag will not prevent eating even if they are covering your face.
#define ITEM_FLAG_FLEXIBLE_MATERIAL FLAG(6)
/// Allows syringes and hyposprays to inject, even if the material is thick
#define ITEM_FLAG_INJECTION_PORT FLAG(7)
/// When applied to footwear, this makes it so that they don't trigger things like landmines and mouse traps
#define ITEM_FLAG_LIGHT_STEP FLAG(8)
/// whether wearing this item will protect you from loud noises such as flashbangs | this only works for ear slots or the head slot
#define ITEM_FLAG_SOUND_PROTECTION FLAG(9)
/// won't block flavourtext when worn on equipment slot
#define ITEM_FLAG_SHOW_FLAVOR_TEXT FLAG(10)
/// Uses the special held maptext system, which sets a specific maptext if the item is in possession of a mob.
#define ITEM_FLAG_HELD_MAP_TEXT FLAG(11)
/// Cannot be moved from its current inventory slot. Mostly for augments, modules, and other "attached" items.
#define ITEM_FLAG_NO_MOVE FLAG(12)
25 changes: 0 additions & 25 deletions code/__defines/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,6 @@
#define SLOT_WRISTS BITFLAG(15)
#define SLOT_S_STORE BITFLAG(16)

// Flags bitmasks.
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
#define CONDUCT 0x2 // Conducts electricity. (metal etc.)
#define ON_BORDER 0x4 // Item has priority to check when entering or leaving.
#define NOBLOODY 0x8 // Used for items if they don't want to get a blood overlay.
#define OPENCONTAINER 0x10 // Is an open container for chemistry purposes.
#define PHORONGUARD 0x20 // Does not get contaminated by phoron.
#define NOREACT 0x40 // Reagents don't react inside this container.
#define PROXMOVE 0x80 // Does this object require proximity checking in Enter()?
#define HELDMAPTEXT 0x100 // Uses the special held maptext system, which sets a specific maptext if the item is in possession of a mob.
#define NOMOVE 0x200 // Cannot be moved from its current inventory slot. Mostly for augments, modules, and other "attached" items.
#define HTML_USE_INITAL_ICON 0x400 // Should we use the initial icon for display? Mostly used by overlay only objects
#define POURCONTAINER 0x800 // reagent container that can pour its contents with a lid on. only used for syrup bottles for now

//Flags for items (equipment)
#define THICKMATERIAL BITFLAG(0) // Prevents syringes, parapens and hyposprays if equiped to slot_suit or slot_head.
#define AIRTIGHT BITFLAG(1) // Functions with internals.
#define NOSLIP BITFLAG(2) // Prevents from slipping on wet floors, in space, etc.
#define BLOCK_GAS_SMOKE_EFFECT BITFLAG(3) // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
#define FLEXIBLEMATERIAL BITFLAG(4) // At the moment, masks with this flag will not prevent eating even if they are covering your face.
#define SOUNDPROTECTION BITFLAG(5) // whether wearing this item will protect you from loud noises such as flashbangs | this only works for ear slots or the head slot
#define LIGHTSTEP BITFLAG(6) // When applied to footwear, this makes it so that they don't trigger things like landmines and mouse traps
#define INJECTIONPORT BITFLAG(7) // Allows syringes and hyposprays to inject, even if the material is thick
#define SHOWFLAVORTEXT BITFLAG(8) // won't block flavourtext when worn on equipment slot

// Flags for pass_flags.
#define PASSTABLE 0x1
#define PASSGLASS 0x2
Expand Down
14 changes: 7 additions & 7 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@
#define DEFAULT_JOB_TYPE /datum/job/assistant

//Area flags, possibly more to come
#define RAD_SHIELDED BITFLAG(1) //shielded from radiation, clearly
#define SPAWN_ROOF BITFLAG(2) // if we should attempt to spawn a roof above us.
#define HIDE_FROM_HOLOMAP BITFLAG(3) // if we shouldn't be drawn on station holomaps
#define FIRING_RANGE BITFLAG(4)
#define NO_CREW_EXPECTED BITFLAG(5) // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level.
#define PRISON BITFLAG(6) // Marks prison area for purposes of checking if brigged/imprisoned
#define NO_GHOST_TELEPORT_ACCESS BITFLAG(7) // Marks whether ghosts should not have teleport access to this area
#define AREA_FLAG_RAD_SHIELDED BITFLAG(1) //shielded from radiation, clearly
#define AREA_FLAG_SPAWN_ROOF BITFLAG(2) // if we should attempt to spawn a roof above us.
#define AREA_FLAG_HIDE_FROM_HOLOMAP BITFLAG(3) // if we shouldn't be drawn on station holomaps
#define AREA_FLAG_FIRING_RANGE BITFLAG(4)
#define AREA_FLAG_NO_CREW_EXPECTED BITFLAG(5) // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level.
#define AREA_FLAG_PRISON BITFLAG(6) // Marks prison area for purposes of checking if brigged/imprisoned
#define AREA_FLAG_NO_GHOST_TELEPORT_ACCESS BITFLAG(7) // Marks whether ghosts should not have teleport access to this area

// Convoluted setup so defines can be supplied by Bay12 main server compile script.
// Should still work fine for people jamming the icons into their repo.
Expand Down
6 changes: 0 additions & 6 deletions code/__defines/obj.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#define OBJ_FLAG_ROTATABLE (1<<1) // Can this object be rotated?
#define OBJ_FLAG_ROTATABLE_ANCHORED (1<<2) // This object can be rotated even while anchored
#define OBJ_FLAG_SIGNALER (1<<3) // Can this take a signaler? only in use for machinery
#define OBJ_FLAG_NOFALL (1<<4) // Will prevent mobs from falling
#define OBJ_FLAG_MOVES_UNSUPPORTED (1<<5) // Object moves with shuttle transition even if turf below is a background turf.

/obj/proc/issurgerycompatible() // set to false for things that are too unwieldy for surgery
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
return
if(QDELETED(A))
return
A.flags |= HTML_USE_INITAL_ICON
A.atom_flags |= ATOM_FLAG_HTML_USE_INITIAL_ICON
if((A.smoothing_flags & SMOOTH_TRUE) || (A.smoothing_flags & SMOOTH_MORE))
var/adjacencies = A.calculate_adjacencies()

Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ lighting determines lighting capturing (optional), suppress_errors suppreses err
if (isnull(icon_state))
icon_state = thing.icon_state
//Despite casting to atom, this code path supports mutable appearances, so let's be nice to them
if(isnull(icon_state) || (isatom(thing) && thing.flags & HTML_USE_INITAL_ICON))
if(isnull(icon_state) || (isatom(thing) && thing.atom_flags & ATOM_FLAG_HTML_USE_INITIAL_ICON))
icon_state = initial(thing.icon_state)
if (isnull(dir))
dir = initial(thing.dir)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ Quick adjacency (to turf):

/*
This checks if you there is uninterrupted airspace between that turf and this one.
This is defined as any dense ON_BORDER object, or any dense object without throwpass.
This is defined as any dense ATOM_FLAG_CHECKS_BORDER object, or any dense object without throwpass.
The border_only flag allows you to not objects (for source and destination squares)
*/
/turf/proc/ClickCross(var/target_dir, var/border_only, var/target_atom = null)
for(var/obj/O in src)
if(!O.density || O == target_atom || O.throwpass)
continue // throwpass is used for anything you can click through

if(O.flags & ON_BORDER) // windows have throwpass but are on border, check them first
if(O.atom_flags & ATOM_FLAG_CHECKS_BORDER) // windows have throwpass but are on border, check them first
if(O.dir & target_dir || O.dir & (O.dir - 1)) // full tile windows are just diagonals mechanically
if(istype(target_atom, /obj/structure/window))
var/obj/structure/window/W = target_atom
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
var/dy = A.y - y

var/direction
if (loc == A.loc && A.flags & ON_BORDER)
if (loc == A.loc && A.atom_flags & ATOM_FLAG_CHECKS_BORDER)
direction = A.dir
else if (!dx && !dy)
return
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/screen_object_types/internals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
user.internal = null

/obj/screen/internals/proc/has_internals_mask(var/mob/living/carbon/human/user)
if(user.wear_mask && HAS_FLAG(user.wear_mask.item_flags, AIRTIGHT))
if(user.wear_mask && HAS_FLAG(user.wear_mask.item_flags, ITEM_FLAG_AIRTIGHT))
return TRUE
if(user.head && HAS_FLAG(user.head.item_flags, AIRTIGHT))
if(user.head && HAS_FLAG(user.head.item_flags, ITEM_FLAG_AIRTIGHT))
return TRUE
return FALSE
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
return

/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags & NOBLUDGEON))
if(!(W.item_flags & ITEM_FLAG_NO_BLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")

/mob/living/attackby(obj/item/I, mob/user)
Expand Down Expand Up @@ -86,7 +86,7 @@ avoid code duplication. This includes items that may sometimes act as a standard

//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone = BP_CHEST)
if(flags & NOBLUDGEON)
if(item_flags & ITEM_FLAG_NO_BLUDGEON)
return 0

if(M == user && user.a_intent != I_HURT)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/initialization/holomap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SUBSYSTEM_DEF(holomap)
A = T.loc
Ttype = T.type

if (A.flags & HIDE_FROM_HOLOMAP)
if (A.area_flags & AREA_FLAG_HIDE_FROM_HOLOMAP)
continue
if (rock_tcache[Ttype])
continue
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/initialization/misc_late.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SUBSYSTEM_DEF(misc_late)
/datum/controller/subsystem/misc_late/Initialize(timeofday)
// Setup the teleport locs.
for(var/area/AR as anything in the_station_areas)
if(AR.flags & NO_GHOST_TELEPORT_ACCESS)
if(AR.area_flags & AREA_FLAG_NO_GHOST_TELEPORT_ACCESS)
continue
var/list/area_turfs = AR.contents
if (area_turfs.len) // Check the area is mapped
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/radiation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ SUBSYSTEM_DEF(radiation)
continue // Radiation is not multi-z
if(source.respect_maint)
var/area/A = T.loc
if(A.flags & RAD_SHIELDED)
if(A.area_flags & AREA_FLAG_RAD_SHIELDED)
continue // In shielded area

var/dist = get_dist(source.source_turf, T)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/helper_datums/teleport.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
else
for(var/atom/movable/A in destturf)
if(A != teleatom && A.density && A.anchored && !istype(A, /obj/effect/portal))
if(A.flags & ON_BORDER)
if(A.atom_flags & ATOM_FLAG_CHECKS_BORDER)
if(prob(10))
impediment = A
break
Expand Down
4 changes: 2 additions & 2 deletions code/defines/obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
density = 0
unacidable = 1//Just to be sure.
var/def_zone
flags = PROXMOVE
movable_flags = MOVABLE_FLAG_PROXMOVE
pass_flags = PASSTABLE | PASSRAILING

/var/list/acting_rank_prefixes = list("acting", "temporary", "interim", "provisional")
Expand Down Expand Up @@ -47,7 +47,7 @@
throwforce = 0.0
throw_speed = 1
throw_range = 20
flags = CONDUCT
obj_flags = OBJ_FLAG_CONDUCTABLE
drop_sound = 'sound/items/drop/rubber.ogg'
pickup_sound = 'sound/items/pickup/rubber.ogg'

Expand Down
8 changes: 4 additions & 4 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = "Should anything ever go wrong..."
icon = 'icons/obj/radio.dmi'
icon_state = "red_phone"
flags = CONDUCT
obj_flags = OBJ_FLAG_CONDUCTABLE
force = 3.0
throwforce = 2.0
throw_speed = 1
Expand Down Expand Up @@ -50,7 +50,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "cane"
item_state = "stick"
flags = CONDUCT
obj_flags = OBJ_FLAG_CONDUCTABLE
force = 10
throwforce = 7.0
w_class = ITEMSIZE_LARGE
Expand Down Expand Up @@ -383,7 +383,7 @@
var/selfdestruct = 0.0
var/traitor_frequency = 0.0
var/obj/item/device/radio/origradio = null
flags = CONDUCT
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT
item_state = "radio"
throwforce = 5
Expand Down Expand Up @@ -435,7 +435,7 @@
icon_state = "std_mod"
w_class = ITEMSIZE_SMALL
item_state = "electronic"
flags = CONDUCT
obj_flags = OBJ_FLAG_CONDUCTABLE
usesound = 'sound/items/Deconstruct.ogg'
var/mtype = 1 // 1=electronic 2=hardware

Expand Down
6 changes: 4 additions & 2 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/area
var/global/global_uid = 0
var/uid
///Bitflag (Any of `AREA_FLAG_*`). See `code\__defines\misc.dm`.
var/area_flags
var/holomap_color // Color of this area on the holomap. Must be a hex color (as string) or null.
var/fire = null
var/atmosalm = 0
Expand Down Expand Up @@ -105,10 +107,10 @@
. = ..()

/area/proc/is_prison()
return flags & PRISON
return area_flags & AREA_FLAG_PRISON

/area/proc/is_no_crew_expected()
return flags & NO_CREW_EXPECTED
return area_flags & AREA_FLAG_NO_CREW_EXPECTED

/area/proc/set_lightswitch(var/state) // Set lights in area. TRUE for on, FALSE for off, NULL for initial state.
if(isnull(state))
Expand Down
Loading