This commit is contained in:
Arkatos1
2019-05-13 22:21:48 +02:00
586 changed files with 12352 additions and 10897 deletions
+2 -21
View File
@@ -1,23 +1,4 @@
/mob/dead/forceMove(atom/destination)
// Overriden from code/game/atoms_movable.dm#141 to prevent things like mice squeaking when ghosts walk on them.
// Same as parent, except that it does not include Uncrossed or Crossed calls.
var/turf/old_loc = loc
var/oldloc = loc
loc = destination
if(old_loc)
old_loc.Exited(src, destination)
if(destination)
destination.Entered(src)
if(isturf(destination) && opacity)
var/turf/new_loc = destination
new_loc.reconsider_lights()
if(isturf(old_loc) && opacity)
old_loc.reconsider_lights()
for(var/datum/light_source/L in light_sources)
L.source_atom.update_light()
return 1
Moved(oldloc, NONE, TRUE)
+1 -1
View File
@@ -1,6 +1,6 @@
/mob/dead/observer/Logout()
if(client)
client.images -= ghost_darkness_images
client.images -= ghost_images
..()
spawn(0)
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
+51 -32
View File
@@ -1,7 +1,7 @@
#define GHOST_CAN_REENTER 1
#define GHOST_IS_OBSERVER 2
var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness
var/list/image/ghost_images = list()
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
@@ -10,7 +10,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
icon = 'icons/mob/mob.dmi'
icon_state = "ghost"
layer = 4
layer = GHOST_LAYER
stat = DEAD
density = 0
canmove = 0
@@ -74,7 +74,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
ghostimage.appearance_flags |= KEEP_TOGETHER
ghostimage.alpha = alpha
appearance_flags |= KEEP_TOGETHER
ghost_darkness_images |= ghostimage
ghost_images |= ghostimage
updateallghostimages()
if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position
forceMove(T)
@@ -90,7 +90,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
M.following_mobs -= src
following = null
if(ghostimage)
ghost_darkness_images -= ghostimage
ghost_images -= ghostimage
QDEL_NULL(ghostimage)
updateallghostimages()
return ..()
@@ -231,31 +231,31 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
P.despawn_occupant()
return
// Ghosts have no momentum, being massless ectoplasm
/mob/dead/observer/Process_Spacemove(movement_dir)
return 1
/mob/dead/observer/Move(NewLoc, direct)
following = null
dir = direct
ghostimage.dir = dir
setDir(direct)
ghostimage.setDir(dir)
var/oldloc = loc
if(NewLoc)
forceMove(NewLoc)
return
forceMove(get_turf(src)) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
y++
else if((direct & SOUTH) && y > 1)
y--
if((direct & EAST) && x < world.maxx)
x++
else if((direct & WEST) && x > 1)
x--
else
forceMove(get_turf(src)) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
y++
else if((direct & SOUTH) && y > 1)
y--
if((direct & EAST) && x < world.maxx)
x++
else if((direct & WEST) && x > 1)
x--
for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb
S.Crossed(src)
var/area/A = get_area(src)
if(A)
A.Entered(src)
..()
Moved(oldloc, direct)
/mob/dead/observer/can_use_hands() return 0
@@ -404,7 +404,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/area/A = input("Area to jump to", "BOOYEA") as null|anything in ghostteleportlocs
var/area/thearea = ghostteleportlocs[A]
if(!thearea)
return
@@ -681,14 +681,32 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost"
ghostvision = !(ghostvision)
updateghostsight()
update_sight()
to_chat(usr, "You [(ghostvision?"now":"no longer")] have ghost vision.")
/mob/dead/observer/verb/toggle_darkness()
set name = "Toggle Darkness"
set category = "Ghost"
seedarkness = !(seedarkness)
updateghostsight()
switch(lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
else
lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
update_sight()
/mob/dead/observer/update_sight()
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING
else
see_invisible = SEE_INVISIBLE_OBSERVER
updateghostimages()
. = ..()
/mob/dead/observer/proc/updateghostsight()
if(!seedarkness)
@@ -696,7 +714,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else
see_invisible = SEE_INVISIBLE_OBSERVER
if(!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING;
see_invisible = SEE_INVISIBLE_LIVING
updateghostimages()
/proc/updateallghostimages()
@@ -706,11 +725,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/proc/updateghostimages()
if(!client)
return
if(seedarkness || !ghostvision)
client.images -= ghost_darkness_images
if(!ghostvision)
client.images -= ghost_images
else
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
client.images |= ghost_darkness_images
client.images |= ghost_images
if(ghostimage)
client.images -= ghostimage //remove ourself