Skip to content

Commit

Permalink
- Categorized invisibility stuff into #defines. If any errors appear …
Browse files Browse the repository at this point in the history
…- let me know.

- Hopefully addressed the concerns about the ultra-darkness. Night vision, mesons, thermals and material scanners now make you see through darkness. (Lighting code does not affect you)
- Ghosts get a "toggle darkness" verb, which changes their see_invisibility. When the toggle is enabled, ghosts cannot see other ghosts. This is due to invisibility.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4235 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
baloh.matevz committed Jul 30, 2012
1 parent 67bf7af commit 1873aa6
Showing 31 changed files with 93 additions and 61 deletions.
2 changes: 1 addition & 1 deletion code/WorkInProgress/virus2/base.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/obj/virus
// a virus instance that is placed on the map, moves, and infects
invisibility = 100
invisibility = INVISIBILITY_LEVEL_ONE00

var/datum/disease2/disease

1 change: 1 addition & 0 deletions code/defines/area/Space Station 13 areas.dm
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "unknown"
layer = 10
mouse_opacity = 0
invisibility = INVISIBILITY_LIGHTING
var/lightswitch = 1

var/area_lights_luminosity = 9 //This gets assigned at area creation. It is used to determine how bright the lights in an area should be. At the time of writing the value that it gets assigned is rand(6,9) - only used for light tubes
1 change: 1 addition & 0 deletions code/defines/mob/living/living.dm
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@
var/now_pushing = null
var/cameraFollow = null
var/tod = null // Time of death
see_invisible = SEE_INVISIBLE_LIVING
2 changes: 1 addition & 1 deletion code/game/asteroid/artifacts.dm
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ var/global/list/spawned_surprises = list()
user.mutations.Add(XRAY)
user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
user.see_in_dark = 8
user.see_invisible = 2
user.see_invisible = SEE_INVISIBLE_LEVEL_TWO

if (!(COLD_RESISTANCE in user.mutations))
user.mutations.Add(COLD_RESISTANCE)
4 changes: 2 additions & 2 deletions code/game/dna.dm
Original file line number Diff line number Diff line change
@@ -425,7 +425,7 @@
M.mutations = list()

M.see_in_dark = 2
M.see_invisible = 0
M.see_invisible = SEE_INVISIBLE_LIVING

if (isblockon(getblock(M.dna.struc_enzymes, 1,3),1))
M.disabilities |= NEARSIGHTED
@@ -460,7 +460,7 @@
M << "\blue The walls suddenly disappear."
M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
M.see_in_dark = 8
M.see_invisible = 2
M.see_invisible = SEE_INVISIBLE_LEVEL_TWO
M.mutations.Add(XRAY)
if (isblockon(getblock(M.dna.struc_enzymes, 9,3),9))
M.disabilities |= NERVOUS
2 changes: 1 addition & 1 deletion code/game/gamemodes/events/ninja_equipment.dm
Original file line number Diff line number Diff line change
@@ -1266,7 +1266,7 @@ ________________________________________________________________________________
U << "Switching mode to <B>Thermal Scanner</B>."
if(2)
mode=3
U.see_invisible = 0
U.see_invisible = SEE_INVISIBLE_LIVING
U.sight &= ~SEE_MOBS
U << "Switching mode to <B>Meson Scanner</B>."
if(3)
2 changes: 1 addition & 1 deletion code/game/gamemodes/events/space_ninja.dm
Original file line number Diff line number Diff line change
@@ -581,7 +581,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.

//Allows the mob to grab a stealth icon.
/mob/proc/NinjaStealthActive(atom/A)//A is the atom which we are using as the overlay.
invisibility = 2//Set ninja invis to 2.
invisibility = INVISIBILITY_LEVEL_TWO//Set ninja invis to 2.
var/icon/opacity_icon = new(A.icon, A.icon_state)
var/icon/alpha_mask = getIconMask(src)
var/icon/alpha_mask_2 = new('icons/effects/effects.dmi', "at_shield1")
4 changes: 2 additions & 2 deletions code/game/machinery/Beacon.dm
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
..()
var/turf/T = loc
Beacon = new /obj/item/device/radio/beacon
Beacon.invisibility = 100
Beacon.invisibility = INVISIBILITY_MAXIMUM
Beacon.loc = T

hide(T.intact)
@@ -44,7 +44,7 @@
if(!Beacon)
var/turf/T = loc
Beacon = new /obj/item/device/radio/beacon
Beacon.invisibility = 100
Beacon.invisibility = INVISIBILITY_MAXIMUM
Beacon.loc = T
if(Beacon)
if(Beacon.loc != loc)
6 changes: 3 additions & 3 deletions code/game/machinery/portable_turret.dm
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
icon_state = "grey_target_prism"
anchored = 1
layer = 3
invisibility = 2 // the turret is invisible if it's inside its cover
invisibility = INVISIBILITY_LEVEL_TWO // the turret is invisible if it's inside its cover
density = 1
use_power = 1 // this turret uses and requires power
idle_power_usage = 50 // when inactive, this turret takes up constant 50 Equipment power
@@ -326,7 +326,7 @@ Status: []<BR>"},

if(!anchored)
anchored = 1
invisibility = 2
invisibility = INVISIBILITY_LEVEL_TWO
icon_state = "[lasercolor]grey_target_prism"
user << "You secure the exterior bolts on the turret."
cover=new/obj/machinery/porta_turret_cover(src.loc) // create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second
@@ -1032,7 +1032,7 @@ Status: []<BR>"},

if(!Parent_Turret.anchored)
Parent_Turret.anchored = 1
Parent_Turret.invisibility = 2
Parent_Turret.invisibility = INVISIBILITY_LEVEL_TWO
Parent_Turret.icon_state = "grey_target_prism"
user << "You secure the exterior bolts on the turret."
else
4 changes: 2 additions & 2 deletions code/game/machinery/turrets.dm
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@
var/enabled = 1
anchored = 1
layer = 3
invisibility = 2
invisibility = INVISIBILITY_LEVEL_TWO
density = 1
var/lasers = 0
var/lasertype = 1
@@ -251,7 +251,7 @@
src.cover.icon_state = "turretCover"
spawn(10)
if (popping==-1)
invisibility = 2
invisibility = INVISIBILITY_LEVEL_TWO
popping = 0

/obj/machinery/turret/bullet_act(var/obj/item/projectile/Proj)
4 changes: 2 additions & 2 deletions code/game/magic/cultist/runes.dm
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ var/list/sacrificed = list()
usr << "\red The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision."
else
usr << "\red The world beyond opens to your eyes."
usr.see_invisible = 15
usr.see_invisible = SEE_INVISIBLE_OBSERVER
usr.seer = 1
return
return fizzle()
@@ -411,7 +411,7 @@ var/list/sacrificed = list()
D.visible_message("\red [D] slowly dissipates into dust and bones.", \
"\red You feel pain, as bonds formed between your soul and this homunculus break.", \
"\red You hear faint rustle.")
ghost.invisibility = 10
ghost.invisibility = INVISIBILITY_OBSERVER
ghost.key = D.key
D.dust()
return
2 changes: 1 addition & 1 deletion code/game/objects/devices/scanners.dm
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ MASS SPECTROMETER
M.invisibility = 0
spawn(2)
if(M)
M.invisibility = 2
M.invisibility = INVISIBILITY_LEVEL_TWO


/obj/item/device/healthanalyzer
2 changes: 1 addition & 1 deletion code/game/objects/grenades/chem_grenade.dm
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@
src.reagents.reaction(A, 1, 10)


invisibility = 100 //Why am i doing this?
invisibility = INVISIBILITY_MAXIMUM //Why am i doing this?
spawn(50) //To make sure all reagents can work
del(src) //correctly before deleting the grenade.
else
2 changes: 1 addition & 1 deletion code/modules/chemical/Chemistry-Tools.dm
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@
src.reagents.reaction(A, 1, 10)
invisibility = 100 //Why am i doing this?
invisibility = INVISIBILITY_LEVEL_ONE00 //Why am i doing this?
spawn(50) //To make sure all reagents can work
del(src) //correctly before deleting the grenade.
else
13 changes: 11 additions & 2 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/mob/dead/observer/New(mob/body, var/can_reenter_corpse = 1)
invisibility = 10
invisibility = INVISIBILITY_OBSERVER
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
see_invisible = 15
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
verbs += /mob/dead/observer/proc/dead_tele
stat = DEAD
@@ -235,3 +235,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/add_memory()
set hidden = 1
src << "\red You are dead! You have no mind to store memory!"

/mob/dead/observer/verb/toggle_darkness()
set name = "Toggle Darkness"
set category = "Ghost"

if (see_invisible == SEE_INVISIBLE_OBSERVER_NOLIGHTING)
see_invisible = SEE_INVISIBLE_OBSERVER
else
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
2 changes: 1 addition & 1 deletion code/modules/mob/living/blob/blob.dm
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
icon_state = "blob_spore_temp"
pass_flags = PASSBLOB
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO
var/ghost_name = "Unknown"
var/creating_blob = 0

4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/alien/humanoid/life.dm
Original file line number Diff line number Diff line change
@@ -453,13 +453,13 @@
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
see_in_dark = 4
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO

if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/alien/larva/life.dm
Original file line number Diff line number Diff line change
@@ -377,13 +377,13 @@
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
see_in_dark = 4
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO

if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/brain/death.dm
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO

tod = worldtime2text() //weasellos time of death patch
if(mind) mind.store_memory("Time of death: [tod]", 0) //mind. ?
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/brain/life.dm
Original file line number Diff line number Diff line change
@@ -216,13 +216,13 @@
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = 0
see_invisible = SEE_INVISIBLE_LIVING

if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
32 changes: 16 additions & 16 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
@@ -801,28 +801,28 @@
if( stat == DEAD )
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_in_dark = 8
if(!druggy) see_invisible = 2
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(healths) healths.icon_state = "health7" //DEAD healthmeter
else
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
switch(mutantrace)
if("lizard","metroid")
see_in_dark = 3
see_invisible = 1
see_invisible = SEE_INVISIBLE_LEVEL_ONE
else
see_in_dark = 2

if(XRAY in mutations)
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
if(!druggy) see_invisible = 2
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO

if(seer)
var/obj/effect/rune/R = locate() in loc
if(R && R.word1 == wordsee && R.word2 == wordhell && R.word3 == wordjoin)
see_invisible = 15
see_invisible = SEE_INVISIBLE_OBSERVER
else
see_invisible = 0
see_invisible = SEE_INVISIBLE_LIVING
seer = 0

if(istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja))
@@ -835,30 +835,30 @@
target_list += target
if(target_list.len)//Everything else is handled by the ninja mask proc.
O.assess_targets(target_list, src)
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING
if(1)
see_in_dark = 5
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING
if(2)
sight |= SEE_MOBS
if(!druggy) see_invisible = 2
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(3)
sight |= SEE_TURFS
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING

if(glasses)
if(istype(glasses, /obj/item/clothing/glasses/meson))
sight |= SEE_TURFS
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/night))
see_in_dark = 5
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/thermal))
sight |= SEE_MOBS
if(!druggy) see_invisible = 2
if(!druggy) see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/material))
sight |= SEE_OBJS
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_MINIMUM

/* HUD shit goes here, as long as it doesn't modify sight flags */
// The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl
@@ -868,18 +868,18 @@
if(istype(glasses, /obj/item/clothing/glasses/sunglasses/sechud))
var/obj/item/clothing/glasses/sunglasses/sechud/O = glasses
if(O.hud) O.hud.process_hud(src)
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING

else if(istype(glasses, /obj/item/clothing/glasses/hud))
var/obj/item/clothing/glasses/hud/health/O = glasses

if(istype(O, /obj/item/clothing/glasses/hud/health))
O.process_hud(src)
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING

else if(istype(O, /obj/item/clothing/glasses/hud/security))
O.process_hud(src)
if(!druggy) see_invisible = 0
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING

if(sleep && !hal_crit) sleep.icon_state = "sleep[sleeping]" //used?

4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/monkey/life.dm
Original file line number Diff line number Diff line change
@@ -468,13 +468,13 @@
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = 0
see_invisible = SEE_INVISIBLE_LIVING

if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/death.dm
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = 2
see_invisible = SEE_INVISIBLE_LEVEL_TWO

var/callshuttle = 0

Loading

0 comments on commit 1873aa6

Please sign in to comment.