Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/_bitfields.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define DEFINE_BITFIELD(_variable, _flags) /datum/bitfield/##_variable { \
flags = ##_flags; \
variable = #_variable; \
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
#define COMSIG_ATOM_SET_LIGHT_COLOR "atom_set_light_color"
///Called right after the atom changes the value of light_color to a different one, from base of [/atom/proc/set_light_color]: (old_color)
#define COMSIG_ATOM_UPDATE_LIGHT_COLOR "atom_update_light_color"
///Called right before the atom changes the value of light_angle to a different one, from base [atom/proc/set_light_angle]: (new_angle)
#define COMSIG_ATOM_SET_LIGHT_ANGLE "atom_set_light_angle"
///Called right after the atom changes the value of light_angle to a different one, from base of [/atom/proc/set_light_angle]: (old_angle)
#define COMSIG_ATOM_UPDATE_LIGHT_ANGLE "atom_update_light_angle"
///Called right before the atom changes the value of light_dir to a different one, from base [atom/proc/set_light_dir]: (new_dir)
#define COMSIG_ATOM_SET_LIGHT_DIR "atom_set_light_dir"
///Called right after the atom changes the value of light_dir to a different one, from base of [/atom/proc/set_light_dir]: (old_dir)
#define COMSIG_ATOM_UPDATE_LIGHT_DIR "atom_update_light_dir"
///Called right before the atom changes the value of light_on to a different one, from base [atom/proc/set_light_on]: (new_value)
#define COMSIG_ATOM_SET_LIGHT_ON "atom_set_light_on"
///Called right after the atom changes the value of light_on to a different one, from base of [/atom/proc/set_light_on]: (old_value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@
#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored"
///from base of atom/movable/setGrabState(): (newstate)
#define COMSIG_MOVABLE_SET_GRAB_STATE "living_set_grab_state"
///Called when the movable tries to change its dynamic light color setting, from base atom/movable/lighting_overlay_set_color(): (color)
#define COMSIG_MOVABLE_LIGHT_OVERLAY_SET_RANGE "movable_light_overlay_set_color"
///Called when the movable tries to change its dynamic light power setting, from base atom/movable/lighting_overlay_set_power(): (power)
#define COMSIG_MOVABLE_LIGHT_OVERLAY_SET_POWER "movable_light_overlay_set_power"
///Called when the movable tries to change its dynamic light range setting, from base atom/movable/lighting_overlay_set_range(): (range)
#define COMSIG_MOVABLE_LIGHT_OVERLAY_SET_COLOR "movable_light_overlay_set_range"
///Called when the movable tries to toggle its dynamic light LIGHTING_ON status, from base atom/movable/lighting_overlay_toggle_on(): (new_state)
#define COMSIG_MOVABLE_LIGHT_OVERLAY_TOGGLE_ON "movable_light_overlay_toggle_on"
///called when the movable's glide size is updated: (new_glide_size)
#define COMSIG_MOVABLE_UPDATE_GLIDE_SIZE "movable_glide_size"
///Called when a movable is hit by a plunger in layer mode, from /obj/item/plunger/attack_atom()
Expand Down
28 changes: 16 additions & 12 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#define ALL (~0) //For convenience.
#define NONE 0

/* Directions */
///All the cardinal direction bitflags.
#define ALL_CARDINALS (NORTH|SOUTH|EAST|WEST)

//for convenience
#define ENABLE_BITFIELD(variable, flag) (variable |= (flag))
#define DISABLE_BITFIELD(variable, flag) (variable &= ~(flag))
Expand Down Expand Up @@ -99,18 +103,18 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
the atom/checkpass() proc uses them (tables will call movable atom checkpass(PASSTABLE) for example)
*/
//flags for pass_flags
#define PASSTABLE (1<<0)
#define PASSGLASS (1<<1)
#define PASSGRILLE (1<<2)
#define PASSBLOB (1<<3)
#define PASSMOB (1<<4)
#define PASSCLOSEDTURF (1<<5)
#define LETPASSTHROW (1<<6)
#define PASSMACHINES (1<<7)
#define PASSCOMPUTER (1<<8)
#define PASSSTRUCTURE (1<<9)
#define PASSDOORS (1<<10)
#define PASSMECH (1<<11)
#define PASSTABLE (1<<0)
#define PASSGLASS (1<<1)
#define PASSGRILLE (1<<2)
#define PASSBLOB (1<<3)
#define PASSMOB (1<<4)
#define PASSCLOSEDTURF (1<<5)
#define LETPASSTHROW (1<<6)
#define PASSMACHINES (1<<7)
#define PASSCOMPUTER (1<<8)
#define PASSSTRUCTURE (1<<9)
#define PASSDOOR (1<<10)
#define PASSMECH (1<<11)

//Movement Types
#define GROUND (1<<0)
Expand Down
12 changes: 9 additions & 3 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
#define STATIC_LIGHT 1
///Light made by masking the lighting darkness plane.
#define MOVABLE_LIGHT 2
/// Light made by masking the lighting darkness plane, and is directional.
#define MOVABLE_LIGHT_DIRECTIONAL 3
///Light made by masking the lighting darkness plane, and is a directionally focused beam.
#define MOVABLE_LIGHT_BEAM 4

#define NONSENSICAL_VALUE -99999

///Is a movable light source attached to another movable (its loc), meaning that the lighting component should go one level deeper.
#define LIGHT_ATTACHED (1<<0)

///This light doesn't affect turf's lumcount calculations. Set to 1<<15 to ignore conflicts
#define LIGHT_NO_LUMCOUNT (1<<15)
/// Freezes a light in its current state, blocking any attempts at modification
#define LIGHT_FROZEN (1<<1)

//Bay lighting engine shit, not in /code/modules/lighting because BYOND is being shit about it
/// frequency, in 1/10ths of a second, of the lighting process
Expand Down Expand Up @@ -67,6 +72,7 @@
#define DYNAMIC_LIGHTING_FORCED 2
/// dynamic lighting enabled only if starlight is.
#define DYNAMIC_LIGHTING_IFSTARLIGHT 3

#define IS_DYNAMIC_LIGHTING(A) A.dynamic_lighting


Expand Down
8 changes: 4 additions & 4 deletions code/__DEFINES/magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/// (effectively making the invocation flavor, instead of required).
#define SPELL_CASTABLE_WITHOUT_INVOCATION (1 << 8)

/*DEFINE_BITFIELD(spell_requirements, list(
DEFINE_BITFIELD(spell_requirements, list(
"SPELL_CASTABLE_AS_BRAIN" = SPELL_CASTABLE_AS_BRAIN,
"SPELL_CASTABLE_WHILE_PHASED" = SPELL_CASTABLE_WHILE_PHASED,
"SPELL_CASTABLE_WITHOUT_INVOCATION" = SPELL_CASTABLE_WITHOUT_INVOCATION,
Expand All @@ -74,7 +74,7 @@
"SPELL_REQUIRES_NO_ANTIMAGIC" = SPELL_REQUIRES_NO_ANTIMAGIC,
"SPELL_REQUIRES_STATION" = SPELL_REQUIRES_STATION,
"SPELL_REQUIRES_WIZARD_GARB" = SPELL_REQUIRES_WIZARD_GARB,
))*/
))

// Bitflags for teleport spells
/// Whether the teleport spell skips over space turfs
Expand All @@ -92,11 +92,11 @@
/// Holy magic resistance that blocks unholy magic (revenant, vampire, voice of god)
#define MAGIC_RESISTANCE_HOLY (1<<2)

/*DEFINE_BITFIELD(antimagic_flags, list(
DEFINE_BITFIELD(antimagic_flags, list(
"MAGIC_RESISTANCE" = MAGIC_RESISTANCE,
"MAGIC_RESISTANCE_HOLY" = MAGIC_RESISTANCE_HOLY,
"MAGIC_RESISTANCE_MIND" = MAGIC_RESISTANCE_MIND,
))*/
))

/**
* Checks if our mob is jaunting actively (within a phased mob object)
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@

///Returns all currently loaded turfs
#define ALL_TURFS(...) block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))

#define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS)
2 changes: 0 additions & 2 deletions code/__DEFINES/{yogs_defines}/flags.dm

This file was deleted.

4 changes: 2 additions & 2 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
Y1+=s
while(Y1!=Y2)
T=locate(X1,Y1,Z)
if(T.opacity)
if(IS_OPAQUE_TURF(T))
return 0
Y1+=s
else
Expand All @@ -338,7 +338,7 @@
else
X1+=signX //Line exits tile horizontally
T=locate(X1,Y1,Z)
if(T.opacity)
if(IS_OPAQUE_TURF(T))
return 0
return 1
#undef SIGNV
Expand Down
12 changes: 4 additions & 8 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -492,17 +492,13 @@ Turf and target are separate in case you want to teleport some distance from a t
current = get_step_towards(current, target_turf)
while(current != target_turf)
if(steps > length)
return 0
if(current.opacity)
return 0
for(var/thing in current)
var/atom/A = thing
if(A.opacity)
return 0
return FALSE
if(IS_OPAQUE_TURF(current))
return FALSE
current = get_step_towards(current, target_turf)
steps++

return 1
return TRUE

/proc/is_anchored_dense_turf(turf/T) //like the older version of the above, fails only if also anchored
if(T.density)
Expand Down
Loading