From f6a99359a98dc95a5311be08e376ecddf9307171 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Sun, 27 Apr 2025 16:47:53 +0200
Subject: [PATCH] move invisibility to defines (#17612)
* move Invisibility to defines
* .
* .
---
code/ATMOSPHERICS/pipes/pipe_base.dm | 2 +-
code/__defines/misc.dm | 2 ++
code/_helpers/unsorted.dm | 2 +-
code/_onclick/hud/ability_screen_objects.dm | 4 ++--
code/_onclick/hud/human.dm | 6 +++---
.../emergency_shuttle_controller.dm | 4 ++--
code/game/dna/genes/monkey.dm | 4 ++--
.../changeling/powers/lesser_form.dm | 2 +-
code/game/gamemodes/cult/construct_spells.dm | 2 +-
code/game/gamemodes/cult/cultify/mob.dm | 4 ++--
code/game/gamemodes/cult/soulstone.dm | 2 +-
code/game/gamemodes/technomancer/core_obj.dm | 4 ++--
.../gamemodes/technomancer/spells/chroma.dm | 2 +-
.../technomancer/spells/energy_siphon.dm | 2 +-
.../technomancer/spells/spawner/darkness.dm | 2 +-
code/game/jobs/job_controller.dm | 2 +-
code/game/json.dm | 2 +-
code/game/machinery/Beacon.dm | 2 +-
.../machinery/computer/specops_shuttle.dm | 2 +-
code/game/machinery/magnet.dm | 2 +-
code/game/machinery/navbeacon.dm | 2 +-
code/game/mecha/mecha.dm | 2 +-
code/game/objects/effects/bump_teleporter.dm | 2 +-
.../effects/decals/Cleanable/humans.dm | 4 ++--
code/game/objects/effects/gibs.dm | 2 +-
code/game/objects/effects/landmarks.dm | 4 ++--
code/game/objects/effects/manifest.dm | 2 +-
.../effects/map_effects/map_effects.dm | 2 +-
.../objects/effects/map_effects/portal.dm | 2 +-
code/game/objects/effects/misc.dm | 2 +-
code/game/objects/effects/prop/snake.dm | 2 +-
code/game/objects/effects/step_triggers.dm | 4 ++--
code/game/objects/effects/wire_deleter.dm | 2 +-
code/game/objects/effects/zone_divider.dm | 2 +-
code/game/objects/items/falling_object_vr.dm | 2 +-
code/game/objects/items/robot/robot_parts.dm | 2 +-
code/game/objects/micro_structures.dm | 2 +-
code/game/objects/mob_spawner_vr.dm | 2 +-
.../objects/structures/ghost_pods/human.dm | 2 +-
code/game/objects/structures/safe.dm | 2 +-
code/modules/admin/admin_verbs.dm | 14 +++++++++----
code/modules/detectivework/tools/uvlight.dm | 2 +-
code/modules/economy/trader.dm | 2 +-
code/modules/entopics_vr/entopics.dm | 4 ++--
code/modules/maint_recycler/code/util.dm | 4 ++--
code/modules/mob/dead/observer/observer.dm | 13 ++++++------
code/modules/mob/death.dm | 6 +++---
code/modules/mob/freelook/eye.dm | 1 +
code/modules/mob/living/carbon/alien/life.dm | 2 +-
code/modules/mob/living/carbon/human/life.dm | 6 +++---
.../carbon/human/species/lleill/hanner.dm | 2 +-
.../carbon/human/species/lleill/lleill.dm | 4 ++--
.../carbon/human/species/lleill/lleill_hud.dm | 2 +-
.../carbon/human/species/shadekin/shadekin.dm | 2 +-
.../human/species/shadekin/shadekin_hud.dm | 5 +----
.../carbon/human/species/station/station.dm | 4 ++--
code/modules/mob/living/life.dm | 2 +-
code/modules/mob/living/living.dm | 2 +-
code/modules/mob/living/silicon/ai/ai.dm | 2 +-
.../silicon/robot/drone/swarm_abilities.dm | 2 +-
code/modules/mob/living/silicon/robot/life.dm | 2 +-
.../subtypes/animal/alien animals/stardog.dm | 6 +++---
code/modules/mob/mob_planes.dm | 6 +++---
code/modules/mob/new_player/new_player.dm | 2 +-
code/modules/mob/transform_procs.dm | 16 +++++++--------
.../modular_computers/file_system/data.dm | 2 +-
code/modules/multiz/_stubs.dm | 2 +-
code/modules/multiz/misc.dm | 2 +-
code/modules/multiz/pipes.dm | 2 +-
code/modules/organs/blood.dm | 2 +-
code/modules/overmap/spacetravel.dm | 2 +-
code/modules/power/cable.dm | 2 +-
.../power/fusion/fusion_particle_catcher.dm | 2 +-
.../power/supermatter/setup_supermatter.dm | 2 +-
code/modules/power/terminal.dm | 2 +-
code/modules/projectiles/projectile/beams.dm | 2 +-
code/modules/projectiles/projectile/change.dm | 2 +-
code/modules/projectiles/projectile/trace.dm | 2 +-
.../recycling/disposal-construction.dm | 2 +-
code/modules/recycling/disposal.dm | 6 +++---
code/modules/rogueminer_vr/landmarks.dm | 4 ++--
code/modules/shieldgen/energy_shield.dm | 2 +-
code/modules/shieldgen/shield_diffuser.dm | 2 +-
code/modules/shuttles/landmarks.dm | 2 +-
code/modules/shuttles/shuttle_specops.dm | 2 +-
.../spells/aoe_turf/conjure/forcewall.dm | 2 +-
.../tgui/modules/appearance_changer.dm | 2 +-
.../xenoarcheaology/effects/forcefield.dm | 4 ++--
maps/common/common_things.dm | 20 +++++++++----------
maps/expedition_vr/alienship/_alienship.dm | 2 +-
maps/offmap_vr/common_offmaps.dm | 2 +-
maps/redgate/falls/atoll_objs.dm | 2 +-
92 files changed, 150 insertions(+), 143 deletions(-)
diff --git a/code/ATMOSPHERICS/pipes/pipe_base.dm b/code/ATMOSPHERICS/pipes/pipe_base.dm
index 2d2ec01aa7..a394b5db0f 100644
--- a/code/ATMOSPHERICS/pipes/pipe_base.dm
+++ b/code/ATMOSPHERICS/pipes/pipe_base.dm
@@ -187,7 +187,7 @@
/obj/machinery/atmospherics/pipe/hide(var/i)
if(istype(loc, /turf/simulated))
- invisibility = i ? 101 : 0
+ invisibility = i ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
update_icon()
/obj/machinery/atmospherics/pipe/process()
diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm
index e0411079ee..12b7c9acd9 100644
--- a/code/__defines/misc.dm
+++ b/code/__defines/misc.dm
@@ -5,6 +5,7 @@
#define TRANSITIONEDGE 1 // Distance from edge to move to another z-level.
// Invisibility constants. These should only be used for TRUE invisibility, AKA nothing living players touch
+#define INVISIBILITY_NONE 0
#define INVISIBILITY_LIGHTING 20
#define INVISIBILITY_LEVEL_ONE 35
#define INVISIBILITY_LEVEL_TWO 45
@@ -21,6 +22,7 @@
#define SEE_INVISIBLE_OBSERVER 61
#define SEE_INVISIBLE_MINIMUM 5
+#define INVISIBILITY_BADMIN 99 // Used for objects that badmins should see
#define INVISIBILITY_MAXIMUM 100
#define INVISIBILITY_ABSTRACT 101 //only used for abstract objects, things that are not really there.
diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm
index 5af6b22c7d..72979f217c 100644
--- a/code/_helpers/unsorted.dm
+++ b/code/_helpers/unsorted.dm
@@ -1234,7 +1234,7 @@ var/mob/dview/dview_mob
dview_mob.loc = null
/mob/dview
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
density = FALSE
anchored = TRUE
diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm
index 5f4bbec8a2..c13e5cf979 100644
--- a/code/_onclick/hud/ability_screen_objects.dm
+++ b/code/_onclick/hud/ability_screen_objects.dm
@@ -100,9 +100,9 @@
/obj/screen/movable/ability_master/update_icon()
if(ability_objects.len)
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
else
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
/obj/screen/movable/ability_master/proc/add_ability(var/name_given)
if(!name) return
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index 5536de74d4..6f2a0f8367 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -416,19 +416,19 @@
regenerate_icons()
/obj/screen/ling
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
/obj/screen/ling/chems
name = "chemical storage"
icon_state = "power_display"
/obj/screen/wizard
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
/obj/screen/wizard/instability
name = "instability"
icon_state = "instability-1"
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
/obj/screen/wizard/energy
name = "energy"
diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm
index 9bdf04629d..c3676d5ea4 100644
--- a/code/controllers/emergency_shuttle_controller.dm
+++ b/code/controllers/emergency_shuttle_controller.dm
@@ -271,10 +271,10 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new
return
/obj/effect/starender
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
/obj/effect/starspawner
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
var/spawndir = SOUTH
var/spawning = 0
diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm
index 08bc48383f..a868e3c721 100644
--- a/code/game/dna/genes/monkey.dm
+++ b/code/game/dna/genes/monkey.dm
@@ -26,7 +26,7 @@
M.transforming = 1
M.canmove = 0
M.icon = null
- M.invisibility = 101
+ M.invisibility = INVISIBILITY_ABSTRACT
var/atom/movable/overlay/animation = new( M.loc )
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
@@ -94,7 +94,7 @@
M.transforming = 1
M.canmove = 0
M.icon = null
- M.invisibility = 101
+ M.invisibility = INVISIBILITY_ABSTRACT
var/atom/movable/overlay/animation = new( M.loc )
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
diff --git a/code/game/gamemodes/changeling/powers/lesser_form.dm b/code/game/gamemodes/changeling/powers/lesser_form.dm
index ff8b553985..be438634aa 100644
--- a/code/game/gamemodes/changeling/powers/lesser_form.dm
+++ b/code/game/gamemodes/changeling/powers/lesser_form.dm
@@ -68,7 +68,7 @@
C.canmove = 0
C.icon = null
C.cut_overlays()
- C.invisibility = 101
+ C.invisibility = INVISIBILITY_ABSTRACT
var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc )
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm
index ba63cff181..eaea934d6c 100644
--- a/code/game/gamemodes/cult/construct_spells.dm
+++ b/code/game/gamemodes/cult/construct_spells.dm
@@ -167,7 +167,7 @@
icon_state = "m_shield_cult"
light_color = "#B40000"
light_range = 2
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
/obj/effect/forcefield/cult/cultify()
return
diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm
index ad9394fe35..dd2f1ba6d1 100644
--- a/code/game/gamemodes/cult/cultify/mob.dm
+++ b/code/game/gamemodes/cult/cultify/mob.dm
@@ -11,7 +11,7 @@
icon = 'icons/mob/mob.dmi'
icon_state = "ghost-narsie"
overlays = 0
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
to_chat(src, span_sinister("Even as a non-corporal being, you can feel Nar-Sie's presence altering you. You are now visible to everyone."))
/mob/living/cultify()
@@ -25,7 +25,7 @@
G.icon = 'icons/mob/mob.dmi'
G.icon_state = "ghost-narsie"
G.overlays = 0
- G.invisibility = 0
+ G.invisibility = INVISIBILITY_NONE
to_chat(G, span_sinister("You feel relieved as what's left of your soul finally escapes its prison of flesh."))
cult.harvested += G.mind
diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm
index 8593779b12..ee8ab147d8 100644
--- a/code/game/gamemodes/cult/soulstone.dm
+++ b/code/game/gamemodes/cult/soulstone.dm
@@ -123,7 +123,7 @@
T.drop_from_inventory(W)
new /obj/effect/decal/remains/human(T.loc) //Spawns a skeleton
- T.invisibility = 101
+ T.invisibility = INVISIBILITY_ABSTRACT
var/atom/movable/overlay/animation = new /atom/movable/overlay( T.loc )
animation.icon_state = "blank"
diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm
index ec7e9df6aa..02baf4a953 100644
--- a/code/game/gamemodes/technomancer/core_obj.dm
+++ b/code/game/gamemodes/technomancer/core_obj.dm
@@ -213,12 +213,12 @@
if(client && hud_used)
if(istype(back, /obj/item/technomancer_core)) //I reckon there's a better way of doing this.
var/obj/item/technomancer_core/core = back
- wiz_energy_display.invisibility = 0
+ wiz_energy_display.invisibility = INVISIBILITY_NONE
var/ratio = core.energy / core.max_energy
ratio = max(round(ratio, 0.05) * 100, 5)
wiz_energy_display.icon_state = "wiz_energy[ratio]"
else
- wiz_energy_display.invisibility = 101
+ wiz_energy_display.invisibility = INVISIBILITY_ABSTRACT
//Resonance Aperture
diff --git a/code/game/gamemodes/technomancer/spells/chroma.dm b/code/game/gamemodes/technomancer/spells/chroma.dm
index 908ea0acc0..d91b39b95e 100644
--- a/code/game/gamemodes/technomancer/spells/chroma.dm
+++ b/code/game/gamemodes/technomancer/spells/chroma.dm
@@ -21,7 +21,7 @@
/obj/effect/temporary_effect/chroma
name = "chroma"
desc = "How are you examining what which cannot be seen?"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
time_to_die = 2 MINUTES //Despawn after this time, if set.
/obj/effect/temporary_effect/chroma/Initialize(mapload, var/new_color = "#FFFFFF")
diff --git a/code/game/gamemodes/technomancer/spells/energy_siphon.dm b/code/game/gamemodes/technomancer/spells/energy_siphon.dm
index 4ed12029be..bc89d629ed 100644
--- a/code/game/gamemodes/technomancer/spells/energy_siphon.dm
+++ b/code/game/gamemodes/technomancer/spells/energy_siphon.dm
@@ -182,7 +182,7 @@
on_impact(A)
density = FALSE
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
qdel(src)
return 1
diff --git a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm
index b424e49bc0..e586fe1501 100644
--- a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm
+++ b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm
@@ -25,7 +25,7 @@
/obj/effect/temporary_effect/darkness
name = "darkness"
time_to_die = 2 MINUTES
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
light_range = 6
light_power = -20
light_on = TRUE
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index b11cf840f3..4167a74cb4 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -422,7 +422,7 @@ var/global/datum/controller/occupations/job_master
// Implants get special treatment
if(G.slot == "implant")
var/obj/item/implant/I = G.spawn_item(H, H.client.prefs.gear[G.display_name])
- I.invisibility = 100
+ I.invisibility = INVISIBILITY_MAXIMUM
I.implant_loadout(H)
continue
diff --git a/code/game/json.dm b/code/game/json.dm
index 6c57e8dd5d..5a0e62b0aa 100644
--- a/code/game/json.dm
+++ b/code/game/json.dm
@@ -83,7 +83,7 @@ var/makejson = 1 //temp
world.Reboot("Switching to [newmap]")
/obj/mapinfo
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
var/mapname = "thismap"
var/decks = 4
/proc/GetMapInfo()
diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm
index 7f18d06231..cbdbfffd56 100644
--- a/code/game/machinery/Beacon.dm
+++ b/code/game/machinery/Beacon.dm
@@ -26,7 +26,7 @@
// update the invisibility and icon
/obj/machinery/bluespace_beacon/hide(var/intact)
- invisibility = intact ? 101 : 0
+ invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
update_icon()
// update the icon_state
diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm
index 8840b5db1a..e87c5e1232 100644
--- a/code/game/machinery/computer/specops_shuttle.dm
+++ b/code/game/machinery/computer/specops_shuttle.dm
@@ -165,7 +165,7 @@ var/specops_shuttle_timeleft = 0
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc)
- P.invisibility = 101//So it is not seen by anyone.
+ P.invisibility = INVISIBILITY_ABSTRACT//So it is not seen by anyone.
P.failchance = 0//So it has no fail chance when teleporting.
P.target = pick(spawn_marauder)//Where the marauder will arrive.
spawn_marauder.Remove(P.target)
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index 75e7f88a2b..5f27c946d5 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -40,7 +40,7 @@
// update the invisibility and icon
/obj/machinery/magnetic_module/hide(var/intact)
- invisibility = intact ? 101 : 0
+ invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
update_icon()
// update the icon_state
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 7a7a540dab..09bf6c021d 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -54,7 +54,7 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do
// called when turf state changes
// hide the object if turf is intact
/obj/machinery/navbeacon/hide(var/intact)
- invisibility = intact ? 101 : 0
+ invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
update_icon()
// update the icon_state
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 35390ee7de..2b3e60dca5 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -2667,7 +2667,7 @@
var/duration = text2num(href_list["duration"])
var/mob/living/silicon/ai/O = new /mob/living/silicon/ai(src)
var/cur_occupant = src.occupant
- O.invisibility = 0
+ O.invisibility = INVISIBILITY_NONE
O.canmove = 1
O.name = AI.name
O.real_name = AI.real_name
diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm
index b374c1a5ac..f12f5acc34 100644
--- a/code/game/objects/effects/bump_teleporter.dm
+++ b/code/game/objects/effects/bump_teleporter.dm
@@ -6,7 +6,7 @@ GLOBAL_LIST_EMPTY(bump_teleporters)
icon_state = "x2"
var/id = null //id of this bump_teleporter.
var/id_target = null //id of bump_teleporter which this moves you to.
- invisibility = 101 //nope, can't see this
+ invisibility = INVISIBILITY_ABSTRACT //nope, can't see this
anchored = TRUE
density = TRUE
opacity = 0
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index 22bce1ad34..94c8d2d0b9 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -33,8 +33,8 @@ var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood/clean_blood()
fluorescent = 0
- if(invisibility != 100)
- invisibility = 100
+ if(invisibility != INVISIBILITY_MAXIMUM)
+ invisibility = INVISIBILITY_MAXIMUM
amount = 0
..(ignore=1)
diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm
index 96859c4aed..b48fe45d46 100644
--- a/code/game/objects/effects/gibs.dm
+++ b/code/game/objects/effects/gibs.dm
@@ -8,7 +8,7 @@
var/list/gibdirections = list() //of lists
var/fleshcolor //Used for gibbed humans.
var/bloodcolor //Used for gibbed humans.
- invisibility = 99 // So a badmin can go view these by changing their see_invisible.
+ invisibility = INVISIBILITY_BADMIN // So a badmin can go view these by changing their see_invisible.
icon = 'icons/effects/map_effects.dmi'
icon_state = "gibspawn"
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index 3fd078827d..30b3f475b0 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -5,13 +5,13 @@
anchored = TRUE
unacidable = TRUE
simulated = FALSE
- invisibility = 100
+ invisibility = INVISIBILITY_MAXIMUM
var/delete_me = FALSE
/obj/effect/landmark/Initialize(mapload)
. = ..()
tag = text("landmark*[]", name)
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
switch(name) //some of these are probably obsolete
if("monkey")
diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm
index 6aae6168a6..99a1a0c937 100644
--- a/code/game/objects/effects/manifest.dm
+++ b/code/game/objects/effects/manifest.dm
@@ -7,7 +7,7 @@
/obj/effect/manifest/Initialize(mapload)
. = ..()
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
/obj/effect/manifest/proc/manifest()
var/dat = span_bold("Crew Manifest") + ":
"
diff --git a/code/game/objects/effects/map_effects/map_effects.dm b/code/game/objects/effects/map_effects/map_effects.dm
index babf67054e..d4f1d01332 100644
--- a/code/game/objects/effects/map_effects/map_effects.dm
+++ b/code/game/objects/effects/map_effects/map_effects.dm
@@ -2,7 +2,7 @@
// Players cannot see or interact with these.
/obj/effect/map_effect
anchored = TRUE
- invisibility = 99 // So a badmin can go view these by changing their see_invisible.
+ invisibility = INVISIBILITY_BADMIN // So a badmin can go view these by changing their see_invisible.
icon = 'icons/effects/map_effects.dmi'
// Below vars concern check_for_player_proximity() and is used to not waste effort if nobody is around to appreciate the effects.
diff --git a/code/game/objects/effects/map_effects/portal.dm b/code/game/objects/effects/map_effects/portal.dm
index 7dd6219fd7..e8bf110d74 100644
--- a/code/game/objects/effects/map_effects/portal.dm
+++ b/code/game/objects/effects/map_effects/portal.dm
@@ -46,7 +46,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec
/obj/effect/map_effect/portal
name = "portal subtype"
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
opacity = TRUE
plane = TURF_PLANE
layer = ABOVE_TURF_LAYER
diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm
index b8adc6f1f0..65186e7525 100644
--- a/code/game/objects/effects/misc.dm
+++ b/code/game/objects/effects/misc.dm
@@ -11,7 +11,7 @@
name = "self deleting effect"
desc = "How are you examining what which cannot be seen?"
icon = 'icons/effects/effects.dmi'
- invisibility = 0
+ invisibility = INVISIBILITY_NONE
var/time_to_die = 10 SECONDS // Afer which, it will delete itself.
/obj/effect/temporary_effect/Initialize(mapload)
diff --git a/code/game/objects/effects/prop/snake.dm b/code/game/objects/effects/prop/snake.dm
index 91503042bf..463c5dc4ca 100644
--- a/code/game/objects/effects/prop/snake.dm
+++ b/code/game/objects/effects/prop/snake.dm
@@ -6,7 +6,7 @@
icon_state = "arrow_omni"
- invisibility = 100
+ invisibility = INVISIBILITY_MAXIMUM
// The atom which created this.
var/atom/movable/creator
diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm
index 65fd34b9a8..3e1fb40a33 100644
--- a/code/game/objects/effects/step_triggers.dm
+++ b/code/game/objects/effects/step_triggers.dm
@@ -5,7 +5,7 @@ GLOBAL_LIST_EMPTY(mapped_autostrips_mob)
/obj/effect/step_trigger
var/affect_ghosts = 0
var/stopper = 1 // stops throwers
- invisibility = 99 // nope cant see this shit
+ invisibility = INVISIBILITY_BADMIN // nope cant see this shit
plane = ABOVE_PLANE
anchored = TRUE
icon = 'icons/mob/screen1.dmi' //VS Edit
@@ -333,7 +333,7 @@ But for now, for what it's been used for, it works.
unacidable = 1
layer = 99
anchored = 1
- invisibility = 99
+ invisibility = INVISIBILITY_BADMIN
/obj/effect/autostriptarget/Initialize(mapload)
diff --git a/code/game/objects/effects/wire_deleter.dm b/code/game/objects/effects/wire_deleter.dm
index 1924ab7b2a..4cdf6647a1 100644
--- a/code/game/objects/effects/wire_deleter.dm
+++ b/code/game/objects/effects/wire_deleter.dm
@@ -5,7 +5,7 @@
anchored = TRUE
unacidable = TRUE
simulated = FALSE
- invisibility = 100
+ invisibility = INVISIBILITY_MAXIMUM
/obj/effect/wire_deleter/Initialize(mapload)
. = ..()
diff --git a/code/game/objects/effects/zone_divider.dm b/code/game/objects/effects/zone_divider.dm
index fef0743f83..c05edbfcf1 100644
--- a/code/game/objects/effects/zone_divider.dm
+++ b/code/game/objects/effects/zone_divider.dm
@@ -3,7 +3,7 @@
name = "zone divider"
icon = 'icons/mob/screen1.dmi'
icon_state = "x3"
- invisibility = 101 //nope, can't see this
+ invisibility = INVISIBILITY_ABSTRACT //nope, can't see this
anchored = TRUE
density = FALSE
opacity = 0
diff --git a/code/game/objects/items/falling_object_vr.dm b/code/game/objects/items/falling_object_vr.dm
index 19d175f1ef..1ee71e9918 100644
--- a/code/game/objects/items/falling_object_vr.dm
+++ b/code/game/objects/items/falling_object_vr.dm
@@ -1,7 +1,7 @@
/obj/effect/falling_effect
name = DEVELOPER_WARNING_NAME
desc = "no data"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
anchored = TRUE
density = FALSE
unacidable = TRUE
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 7c5d4bc617..be65f5abce 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -199,7 +199,7 @@
O.mmi = W
O.post_mmi_setup()
- O.invisibility = 0
+ O.invisibility = INVISIBILITY_NONE
O.custom_name = created_name
O.updatename("Default")
diff --git a/code/game/objects/micro_structures.dm b/code/game/objects/micro_structures.dm
index cbd13f68db..6e769f1c30 100644
--- a/code/game/objects/micro_structures.dm
+++ b/code/game/objects/micro_structures.dm
@@ -448,7 +448,7 @@ GLOBAL_LIST_EMPTY(micro_tunnels)
name = "mouse hole spawner"
icon = 'icons/obj/landmark_vr.dmi'
icon_state = "blue-x"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
var/chance_to_spawn = 25
diff --git a/code/game/objects/mob_spawner_vr.dm b/code/game/objects/mob_spawner_vr.dm
index e0593cbe0f..cb35117f8e 100644
--- a/code/game/objects/mob_spawner_vr.dm
+++ b/code/game/objects/mob_spawner_vr.dm
@@ -154,7 +154,7 @@ It also makes it so a ghost wont know where all the goodies/mobs are.
total_spawns = -1
destructible = 0
anchored = TRUE
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
spawn_types = list(
/mob/living/simple_mob/animal/passive/gaslamp = 20,
// /mob/living/simple_mob/vore/otie/feral = 10,
diff --git a/code/game/objects/structures/ghost_pods/human.dm b/code/game/objects/structures/ghost_pods/human.dm
index 8841ac998b..ae1a10ef2a 100644
--- a/code/game/objects/structures/ghost_pods/human.dm
+++ b/code/game/objects/structures/ghost_pods/human.dm
@@ -11,7 +11,7 @@
density = FALSE
ghost_query_type = /datum/ghost_query/stowaway
anchored = TRUE
- invisibility = 60
+ invisibility = INVISIBILITY_OBSERVER
var/occupant_type = "stowaway"
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index 3bd50f5f00..03d050e010 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -185,7 +185,7 @@ FLOOR SAFES
update_icon()
/obj/structure/safe/floor/hide(var/intact)
- invisibility = intact ? 101 : 0
+ invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE
/obj/structure/safe/floor/hides_under_flooring()
return 1
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index aeeda5712e..61279418a0 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -83,15 +83,21 @@
set name = "Invisimin"
set category = "Admin.Game"
set desc = "Toggles ghost-like invisibility (Don't abuse this)"
+
if(holder && mob)
+ if(mob.invisibility > INVISIBILITY_OBSERVER)
+ to_chat(mob, span_warning("You can't use this, your current invisibility level ([mob.invisibility]) is above the observer level ([INVISIBILITY_OBSERVER])."))
+ return
+
if(mob.invisibility == INVISIBILITY_OBSERVER)
mob.invisibility = initial(mob.invisibility)
to_chat(mob, span_filter_system(span_danger("Invisimin off. Invisibility reset.")))
mob.alpha = max(mob.alpha + 100, 255)
- else
- mob.invisibility = INVISIBILITY_OBSERVER
- to_chat(mob, span_filter_system(span_boldnotice("Invisimin on. You are now as invisible as a ghost.")))
- mob.alpha = max(mob.alpha - 100, 0)
+ return
+
+ mob.invisibility = INVISIBILITY_OBSERVER
+ to_chat(mob, span_filter_system(span_boldnotice("Invisimin on. You are now as invisible as a ghost.")))
+ mob.alpha = max(mob.alpha - 100, 0)
/client/proc/player_panel()
diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm
index 29aca9fe31..fec338a5d1 100644
--- a/code/modules/detectivework/tools/uvlight.dm
+++ b/code/modules/detectivework/tools/uvlight.dm
@@ -63,7 +63,7 @@
A.fluorescent = 2 //To prevent light crosstalk.
if(A.invisibility)
scanned[A] = A.invisibility
- A.invisibility = 0
+ A.invisibility = INVISIBILITY_NONE
stored_alpha[A] = A.alpha
A.alpha = use_alpha
if(istype(A, /obj/item))
diff --git a/code/modules/economy/trader.dm b/code/modules/economy/trader.dm
index cbfe3dac1b..485ba91b3b 100644
--- a/code/modules/economy/trader.dm
+++ b/code/modules/economy/trader.dm
@@ -265,7 +265,7 @@
desc = "A trader can be moved to here!"
icon = 'icons/obj/landmark_vr.dmi'
icon_state = "blue-x"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
mouse_opacity = 0
density = 0
anchored = 1
diff --git a/code/modules/entopics_vr/entopics.dm b/code/modules/entopics_vr/entopics.dm
index d31bfb78f8..18941311a1 100644
--- a/code/modules/entopics_vr/entopics.dm
+++ b/code/modules/entopics_vr/entopics.dm
@@ -96,7 +96,7 @@ var/global/list/alt_farmanimals = list()
return
my_image.mouse_opacity = 1
- my_image.invisibility = 0
+ my_image.invisibility = INVISIBILITY_NONE
my_image.alpha = alpha
my_image.override = override
@@ -105,7 +105,7 @@ var/global/list/alt_farmanimals = list()
return
my_image.mouse_opacity = 0
- my_image.invisibility = 101
+ my_image.invisibility = INVISIBILITY_ABSTRACT
my_image.alpha = 0
my_image.override = FALSE
diff --git a/code/modules/maint_recycler/code/util.dm b/code/modules/maint_recycler/code/util.dm
index 0e1efcf2eb..be078dc48b 100644
--- a/code/modules/maint_recycler/code/util.dm
+++ b/code/modules/maint_recycler/code/util.dm
@@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(recycler_locations)
/obj/effect/recycler_beacon
icon = 'code/modules/maint_recycler/icons/maint_recycler.dmi'
icon_state = "marker"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
mouse_opacity = 0
density = 0
anchored = 1
@@ -39,7 +39,7 @@ GLOBAL_LIST_EMPTY(recycler_locations)
/obj/effect/recycler_vendor_beacon
icon = 'code/modules/maint_recycler/icons/maint_vendor.dmi'
icon_state = "marker"
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
pixel_x = -8
mouse_opacity = 0
density = 0
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index cb437ff049..d666a38d99 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -93,17 +93,18 @@
var/last_revive_notification = null // world.time of last notification, used to avoid spamming players from defibs or cloners.
var/cleanup_timer // Refernece to a timer that will delete this mob if no client returns
-/mob/observer/dead/Initialize(mapload, aghost = FALSE)
-
- appearance = loc
invisibility = INVISIBILITY_OBSERVER
layer = BELOW_MOB_LAYER
plane = PLANE_GHOSTS
alpha = 127
+ sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
+ see_invisible = SEE_INVISIBLE_OBSERVER
+
+/mob/observer/dead/Initialize(mapload, aghost = FALSE)
+
+ appearance = loc
admin_ghosted = aghost
- sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
- see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = world.view //I mean. I don't even know if byond has occlusion culling... but...
var/turf/T
@@ -900,7 +901,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(src, span_info("You are now visible!"))
plane = (plane == PLANE_GHOSTS) ? PLANE_WORLD : PLANE_GHOSTS
- invisibility = (plane == PLANE_WORLD) ? 0 : INVISIBILITY_OBSERVER
+ invisibility = (plane == PLANE_WORLD) ? INVISIBILITY_NONE : INVISIBILITY_OBSERVER
// Give the ghost a cult icon which should be visible only to itself
toggle_icon("cult")
diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm
index 0c843de3fc..1096deb288 100644
--- a/code/modules/mob/death.dm
+++ b/code/modules/mob/death.dm
@@ -6,7 +6,7 @@
transforming = 1
canmove = 0
icon = null
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
update_canmove()
dead_mob_list -= src
@@ -32,7 +32,7 @@
transforming = 1
canmove = 0
icon = null
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
animation = new(loc)
animation.icon_state = "blank"
@@ -53,7 +53,7 @@
transforming = 1
canmove = 0
icon = null
- invisibility = 101
+ invisibility = INVISIBILITY_ABSTRACT
animation = new(loc)
animation.icon_state = "blank"
diff --git a/code/modules/mob/freelook/eye.dm b/code/modules/mob/freelook/eye.dm
index 262ffe5521..1cf279ddba 100644
--- a/code/modules/mob/freelook/eye.dm
+++ b/code/modules/mob/freelook/eye.dm
@@ -17,6 +17,7 @@
see_in_dark = 7
status_flags = GODMODE
plane = PLANE_AI_EYE
+ invisibility = INVISIBILITY_EYE
var/mob/owner = null
var/list/visibleChunks = list()
diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm
index e84ad2e8b1..b8fb2c550f 100644
--- a/code/modules/mob/living/carbon/alien/life.dm
+++ b/code/modules/mob/living/carbon/alien/life.dm
@@ -1,7 +1,7 @@
// Alien larva are quite simple.
/mob/living/carbon/alien/Life()
- set invisibility = 0
+ set invisibility = INVISIBILITY_NONE
if (transforming) return
if(!loc) return
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 9397e45448..725902f322 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -20,7 +20,7 @@
var/chemical_darksight = 0
/mob/living/carbon/human/Life()
- set invisibility = 0
+ set invisibility = INVISIBILITY_NONE
set background = BACKGROUND_ENABLED
if (transforming)
@@ -1868,7 +1868,7 @@
if(mind && mind.changeling)
mind.changeling.regenerate()
if(hud_used)
- ling_chem_display.invisibility = 0
+ ling_chem_display.invisibility = INVISIBILITY_NONE
// ling_chem_display.maptext = "