mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Ports /tg/ & Paradise ghost sight.
Ghosts can now toggle darkness and seeing ghostly things independently. Includes some extra work to allow observers to see AI eyes while (mostly) preventing cultists from doing the same.
This commit is contained in:
@@ -1072,6 +1072,7 @@
|
||||
#include "code\modules\mob\typing_indicator.dm"
|
||||
#include "code\modules\mob\update_icons.dm"
|
||||
#include "code\modules\mob\dead\death.dm"
|
||||
#include "code\modules\mob\dead\observer\login.dm"
|
||||
#include "code\modules\mob\dead\observer\logout.dm"
|
||||
#include "code\modules\mob\dead\observer\observer.dm"
|
||||
#include "code\modules\mob\dead\observer\say.dm"
|
||||
|
||||
@@ -263,12 +263,12 @@ var/list/sacrificed = list()
|
||||
usr.seer = 0
|
||||
else if(usr.see_invisible!=SEE_INVISIBLE_LIVING)
|
||||
usr << "\red The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision."
|
||||
usr.see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
usr.see_invisible = SEE_INVISIBLE_CULT
|
||||
usr.seer = 0
|
||||
else
|
||||
usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium vivira. Itonis al'ra matum!")
|
||||
usr << "\red The world beyond opens to your eyes."
|
||||
usr.see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
usr.see_invisible = SEE_INVISIBLE_CULT
|
||||
usr.seer = 1
|
||||
return
|
||||
return fizzle()
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
/mob/dead/observer/Login()
|
||||
..()
|
||||
if (ghostimage)
|
||||
ghostimage.icon_state = src.icon_state
|
||||
updateghostimages()
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
var/global/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/global/list/image/ghost_sightless_images = list() //this is a list of images for things ghosts should still be able to see even without ghost sight
|
||||
|
||||
/mob/dead/observer
|
||||
name = "ghost"
|
||||
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
|
||||
@@ -23,15 +26,22 @@
|
||||
var/atom/movable/following = null
|
||||
var/admin_ghosted = 0
|
||||
var/anonsay = 0
|
||||
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
|
||||
var/ghostvision = 1 //is the ghost able to see things humans can't?
|
||||
var/seedarkness = 1
|
||||
|
||||
/mob/dead/observer/New(mob/body)
|
||||
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_AI_EYE
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
see_in_dark = 100
|
||||
verbs += /mob/dead/observer/proc/dead_tele
|
||||
|
||||
stat = DEAD
|
||||
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
ghost_darkness_images |= ghostimage
|
||||
updateallghostimages()
|
||||
|
||||
var/turf/T
|
||||
if(ismob(body))
|
||||
T = get_turf(body) //Where is the body located?
|
||||
@@ -70,7 +80,13 @@
|
||||
real_name = name
|
||||
..()
|
||||
|
||||
|
||||
/mob/dead/observer/Del()
|
||||
if (ghostimage)
|
||||
ghost_darkness_images -= ghostimage
|
||||
del(ghostimage)
|
||||
ghostimage = null
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
@@ -403,22 +419,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)"
|
||||
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"
|
||||
|
||||
|
||||
/mob/dead/observer/verb/toggle_sight()
|
||||
set name = "Toggle Sight"
|
||||
set category = "Ghost"
|
||||
|
||||
switch(see_invisible)
|
||||
if(SEE_INVISIBLE_OBSERVER_AI_EYE)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_NOOBSERVERS
|
||||
usr << "<span class='notice'>You no longer see other observers or the AI eye.</span>"
|
||||
if(SEE_INVISIBLE_OBSERVER_NOOBSERVERS)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
|
||||
usr << "<span class='notice'>You no longer see darkness.</span>"
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_AI_EYE
|
||||
usr << "<span class='notice'>You again see everything.</span>"
|
||||
|
||||
/mob/dead/observer/verb/become_mouse()
|
||||
set name = "Become mouse"
|
||||
set category = "Ghost"
|
||||
@@ -620,3 +620,43 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/canface()
|
||||
return 1
|
||||
|
||||
/mob/dead/observer/verb/toggle_ghostsee()
|
||||
set name = "Toggle Ghost Vision"
|
||||
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
|
||||
set category = "Ghost"
|
||||
ghostvision = !(ghostvision)
|
||||
updateghostsight()
|
||||
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()
|
||||
|
||||
/mob/dead/observer/proc/updateghostsight()
|
||||
if (!seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
if (!ghostvision)
|
||||
see_invisible = SEE_INVISIBLE_LIVING;
|
||||
updateghostimages()
|
||||
|
||||
/proc/updateallghostimages()
|
||||
for (var/mob/dead/observer/O in player_list)
|
||||
O.updateghostimages()
|
||||
|
||||
/mob/dead/observer/proc/updateghostimages()
|
||||
if (!client)
|
||||
return
|
||||
if (seedarkness || !ghostvision)
|
||||
client.images -= ghost_darkness_images
|
||||
client.images |= ghost_sightless_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_sightless_images
|
||||
client.images |= ghost_darkness_images
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
|
||||
@@ -1201,7 +1201,7 @@
|
||||
if(seer==1)
|
||||
var/obj/effect/rune/R = locate() in loc
|
||||
if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"])
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
see_invisible = SEE_INVISIBLE_CULT
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
seer = 0
|
||||
|
||||
@@ -14,17 +14,34 @@
|
||||
status_flags = GODMODE // You can't damage it.
|
||||
see_in_dark = 7
|
||||
invisibility = INVISIBILITY_AI_EYE
|
||||
var/ghostimage = null
|
||||
|
||||
/mob/aiEye/New()
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
ghost_darkness_images |= ghostimage //so ghosts can see the AI eye when they disable darkness
|
||||
ghost_sightless_images |= ghostimage //so ghosts can see the AI eye when they disable ghost sight
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
mob/aiEye/Del()
|
||||
if (ghostimage)
|
||||
ghost_darkness_images -= ghostimage
|
||||
ghost_sightless_images -= ghostimage
|
||||
del(ghostimage)
|
||||
ghostimage = null;
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
// Movement code. Returns 0 to stop air movement from moving it.
|
||||
/mob/aiEye/Move()
|
||||
return 0
|
||||
|
||||
/mob/aiEye/examinate(atom/A as mob|obj|turf in view())
|
||||
/mob/aiEye/examinate()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
/mob/aiEye/pointed(atom/A as mob|obj|turf in view())
|
||||
/mob/aiEye/pointed()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
@@ -457,18 +457,17 @@
|
||||
#define INVISIBILITY_LEVEL_ONE 35
|
||||
#define INVISIBILITY_LEVEL_TWO 45
|
||||
#define INVISIBILITY_OBSERVER 60
|
||||
#define INVISIBILITY_AI_EYE 61
|
||||
#define INVISIBILITY_AI_EYE 61
|
||||
|
||||
#define SEE_INVISIBLE_LIVING 25
|
||||
#define SEE_INVISIBLE_OBSERVER_NOLIGHTING 15
|
||||
#define SEE_INVISIBLE_LEVEL_ONE 35
|
||||
#define SEE_INVISIBLE_LEVEL_TWO 45
|
||||
#define SEE_INVISIBLE_OBSERVER_NOOBSERVERS 59
|
||||
#define SEE_INVISIBLE_OBSERVER 60
|
||||
#define SEE_INVISIBLE_OBSERVER_AI_EYE 61
|
||||
#define SEE_INVISIBLE_CULT 60
|
||||
#define SEE_INVISIBLE_OBSERVER 61
|
||||
|
||||
#define SEE_INVISIBLE_MINIMUM 5
|
||||
#define INVISIBILITY_MAXIMUM 100
|
||||
#define INVISIBILITY_MAXIMUM 100
|
||||
|
||||
// Object specific defines.
|
||||
#define CANDLE_LUM 3 // For how bright candles are.
|
||||
|
||||
Reference in New Issue
Block a user