April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/mob/dead/observer/Logout()
|
||||
if (client)
|
||||
client.images -= ghost_darkness_images
|
||||
client.images -= (GLOB.ghost_images_default+GLOB.ghost_images_simple)
|
||||
|
||||
if(observetarget)
|
||||
if(ismob(observetarget))
|
||||
var/mob/target = observetarget
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
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, BUT NOT THE GHOSTS THEMSELVES!
|
||||
var/list/image/ghost_images_full = list() //this is a list of full images of the ghosts themselves
|
||||
var/list/image/ghost_images_default = list() //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves
|
||||
var/list/image/ghost_images_simple = list() //this is a list of all ghost images as the simple white ghost
|
||||
GLOBAL_LIST_EMPTY(ghost_images_default) //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves
|
||||
GLOBAL_LIST_EMPTY(ghost_images_simple) //this is a list of all ghost images as the simple white ghost
|
||||
|
||||
var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
/mob/dead/observer
|
||||
name = "ghost"
|
||||
@@ -19,8 +17,6 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
see_in_dark = 100
|
||||
invisibility = INVISIBILITY_OBSERVER
|
||||
languages_spoken = ALL
|
||||
languages_understood = ALL
|
||||
var/can_reenter_corpse
|
||||
var/datum/hud/living/carbon/hud = null // hud
|
||||
var/bootime = 0
|
||||
@@ -29,11 +25,9 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
|
||||
var/atom/movable/following = null
|
||||
var/fun_verbs = 0
|
||||
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
|
||||
var/image/ghostimage_default = null //this mobs ghost image without accessories and dirs
|
||||
var/image/ghostimage_simple = null //this mob with the simple white ghost sprite
|
||||
var/ghostvision = 1 //is the ghost able to see things humans can't?
|
||||
var/seedarkness = 1
|
||||
var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout()
|
||||
var/ghost_hud_enabled = 1 //did this ghost disable the on-screen HUD?
|
||||
var/data_huds_on = 0 //Are data HUDs currently enabled?
|
||||
@@ -60,22 +54,24 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
var/deadchat_name
|
||||
|
||||
/mob/dead/observer/Initialize()
|
||||
invisibility = observer_default_invisibility
|
||||
invisibility = GLOB.observer_default_invisibility
|
||||
|
||||
verbs += /mob/dead/observer/proc/dead_tele
|
||||
|
||||
if(config.cross_allowed)
|
||||
verbs += /mob/dead/observer/proc/server_hop
|
||||
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
if(icon_state in ghost_forms_with_directions_list)
|
||||
if(icon_state in GLOB.ghost_forms_with_directions_list)
|
||||
ghostimage_default = image(src.icon,src,src.icon_state + "_nodir")
|
||||
else
|
||||
ghostimage_default = image(src.icon,src,src.icon_state)
|
||||
ghostimage_default.override = TRUE
|
||||
GLOB.ghost_images_default |= ghostimage_default
|
||||
|
||||
ghostimage_simple = image(src.icon,src,"ghost_nodir")
|
||||
ghost_images_full |= ghostimage
|
||||
ghost_images_default |= ghostimage_default
|
||||
ghost_images_simple |= ghostimage_simple
|
||||
ghostimage_simple.override = TRUE
|
||||
GLOB.ghost_images_simple |= ghostimage_simple
|
||||
|
||||
updateallghostimages()
|
||||
|
||||
var/turf/T
|
||||
@@ -123,6 +119,8 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
verbs -= /mob/dead/observer/verb/possess
|
||||
|
||||
animate(src, pixel_y = 2, time = 10, loop = -1)
|
||||
|
||||
grant_all_languages()
|
||||
..()
|
||||
|
||||
/mob/dead/observer/narsie_act()
|
||||
@@ -137,16 +135,11 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
animate(src, color = old_color, time = 10)
|
||||
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 10)
|
||||
|
||||
/mob/dead/observer/Destroy()
|
||||
ghost_images_full -= ghostimage
|
||||
qdel(ghostimage)
|
||||
ghostimage = null
|
||||
|
||||
ghost_images_default -= ghostimage_default
|
||||
GLOB.ghost_images_default -= ghostimage_default
|
||||
qdel(ghostimage_default)
|
||||
ghostimage_default = null
|
||||
|
||||
ghost_images_simple -= ghostimage_simple
|
||||
GLOB.ghost_images_simple -= ghostimage_simple
|
||||
qdel(ghostimage_simple)
|
||||
ghostimage_simple = null
|
||||
|
||||
@@ -170,49 +163,44 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
|
||||
if(hair_image)
|
||||
cut_overlay(hair_image)
|
||||
ghostimage.add_overlay(hair_image)
|
||||
hair_image = null
|
||||
|
||||
if(facial_hair_image)
|
||||
cut_overlay(facial_hair_image)
|
||||
ghostimage.add_overlay(facial_hair_image)
|
||||
facial_hair_image = null
|
||||
|
||||
|
||||
if(new_form)
|
||||
icon_state = new_form
|
||||
ghostimage.icon_state = new_form
|
||||
if(icon_state in ghost_forms_with_directions_list)
|
||||
if(icon_state in GLOB.ghost_forms_with_directions_list)
|
||||
ghostimage_default.icon_state = new_form + "_nodir" //if this icon has dirs, the default ghostimage must use its nodir version or clients with the preference set to default sprites only will see the dirs
|
||||
else
|
||||
ghostimage_default.icon_state = new_form
|
||||
|
||||
if(ghost_accs >= GHOST_ACCS_DIR && icon_state in ghost_forms_with_directions_list) //if this icon has dirs AND the client wants to show them, we make sure we update the dir on movement
|
||||
if(ghost_accs >= GHOST_ACCS_DIR && icon_state in GLOB.ghost_forms_with_directions_list) //if this icon has dirs AND the client wants to show them, we make sure we update the dir on movement
|
||||
updatedir = 1
|
||||
else
|
||||
updatedir = 0 //stop updating the dir in case we want to show accessories with dirs on a ghost sprite without dirs
|
||||
setDir(2 )//reset the dir to its default so the sprites all properly align up
|
||||
|
||||
if(ghost_accs == GHOST_ACCS_FULL && icon_state in ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them
|
||||
if(ghost_accs == GHOST_ACCS_FULL && icon_state in GLOB.ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them
|
||||
var/datum/sprite_accessory/S
|
||||
if(facial_hair_style)
|
||||
S = facial_hair_styles_list[facial_hair_style]
|
||||
S = GLOB.facial_hair_styles_list[facial_hair_style]
|
||||
if(S)
|
||||
facial_hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER)
|
||||
if(facial_hair_color)
|
||||
facial_hair_image.color = "#" + facial_hair_color
|
||||
facial_hair_image.alpha = 200
|
||||
add_overlay(facial_hair_image)
|
||||
ghostimage.add_overlay(facial_hair_image)
|
||||
if(hair_style)
|
||||
S = hair_styles_list[hair_style]
|
||||
S = GLOB.hair_styles_list[hair_style]
|
||||
if(S)
|
||||
hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER)
|
||||
if(hair_color)
|
||||
hair_image.color = "#" + hair_color
|
||||
hair_image.alpha = 200
|
||||
add_overlay(hair_image)
|
||||
ghostimage.add_overlay(hair_image)
|
||||
|
||||
/*
|
||||
* Increase the brightness of a color by calculating the average distance between the R, G and B values,
|
||||
@@ -310,14 +298,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
if(ticker && ticker.mode)
|
||||
for(var/datum/gang/G in ticker.mode.gangs)
|
||||
if(SSticker && SSticker.mode)
|
||||
for(var/datum/gang/G in SSticker.mode.gangs)
|
||||
if(G.is_dominating)
|
||||
stat(null, "[G.name] Gang Takeover: [max(G.domination_time_remaining(), 0)]")
|
||||
if(istype(ticker.mode, /datum/game_mode/blob))
|
||||
var/datum/game_mode/blob/B = ticker.mode
|
||||
if(istype(SSticker.mode, /datum/game_mode/blob))
|
||||
var/datum/game_mode/blob/B = SSticker.mode
|
||||
if(B.message_sent)
|
||||
stat(null, "Blobs to Blob Win: [blobs_legit.len]/[B.blobwincount]")
|
||||
stat(null, "Blobs to Blob Win: [GLOB.blobs_legit.len]/[B.blobwincount]")
|
||||
|
||||
/mob/dead/observer/verb/reenter_corpse()
|
||||
set category = "Ghost"
|
||||
@@ -368,7 +356,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
to_chat(usr, "Not when you're not dead!")
|
||||
return
|
||||
var/A
|
||||
A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas
|
||||
A = input("Area to jump to", "BOOYEA", A) as null|anything in GLOB.sortedAreas
|
||||
var/area/thearea = A
|
||||
if(!thearea)
|
||||
return
|
||||
@@ -510,35 +498,42 @@ 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
|
||||
|
||||
/mob/dead/observer/proc/updateghostsight()
|
||||
update_sight()
|
||||
|
||||
/mob/dead/observer/update_sight()
|
||||
if(client)
|
||||
ghost_others = client.prefs.ghost_others //A quick update just in case this setting was changed right before calling the proc
|
||||
|
||||
if (seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
if (!ghostvision || ghost_others <= GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
if (!ghostvision)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
|
||||
|
||||
updateghostimages()
|
||||
..()
|
||||
|
||||
/proc/updateallghostimages()
|
||||
listclearnulls(ghost_images_full)
|
||||
listclearnulls(ghost_images_default)
|
||||
listclearnulls(ghost_images_simple)
|
||||
listclearnulls(ghost_darkness_images)
|
||||
listclearnulls(GLOB.ghost_images_default)
|
||||
listclearnulls(GLOB.ghost_images_simple)
|
||||
|
||||
for (var/mob/dead/observer/O in player_list)
|
||||
for (var/mob/dead/observer/O in GLOB.player_list)
|
||||
O.updateghostimages()
|
||||
|
||||
/mob/dead/observer/proc/updateghostimages()
|
||||
@@ -547,34 +542,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
if(lastsetting)
|
||||
switch(lastsetting) //checks the setting we last came from, for a little efficiency so we don't try to delete images from the client that it doesn't have anyway
|
||||
if(GHOST_OTHERS_THEIR_SETTING)
|
||||
client.images -= ghost_images_full
|
||||
if(GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
client.images -= ghost_images_default
|
||||
client.images -= GLOB.ghost_images_default
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client.images -= ghost_images_simple
|
||||
|
||||
if ((seedarkness || !ghostvision) && client.prefs.ghost_others == GHOST_OTHERS_THEIR_SETTING)
|
||||
client.images -= ghost_darkness_images
|
||||
lastsetting = null
|
||||
else if(ghostvision && (!seedarkness || client.prefs.ghost_others <= GHOST_OTHERS_DEFAULT_SPRITE))
|
||||
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
|
||||
if(!lastsetting)
|
||||
client.images |= ghost_darkness_images
|
||||
client.images -= GLOB.ghost_images_simple
|
||||
lastsetting = client.prefs.ghost_others
|
||||
if(!ghostvision)
|
||||
return
|
||||
if(client.prefs.ghost_others != GHOST_OTHERS_THEIR_SETTING)
|
||||
switch(client.prefs.ghost_others)
|
||||
if(GHOST_OTHERS_THEIR_SETTING)
|
||||
client.images |= ghost_images_full
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
if(GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
client.images |= ghost_images_default
|
||||
if(ghostimage_default)
|
||||
client.images -= ghostimage_default
|
||||
client.images |= (GLOB.ghost_images_default-ghostimage_default)
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client.images |= ghost_images_simple
|
||||
if(ghostimage_simple)
|
||||
client.images -= ghostimage_simple
|
||||
lastsetting = client.prefs.ghost_others
|
||||
client.images |= (GLOB.ghost_images_simple-ghostimage_simple)
|
||||
|
||||
/mob/dead/observer/verb/possess()
|
||||
set category = "Ghost"
|
||||
@@ -582,8 +562,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set desc= "Take over the body of a mindless creature!"
|
||||
|
||||
var/list/possessible = list()
|
||||
for(var/mob/living/L in living_mob_list)
|
||||
if(!(L in player_list) && !L.mind)
|
||||
for(var/mob/living/L in GLOB.living_mob_list)
|
||||
if(!(L in GLOB.player_list) && !L.mind)
|
||||
possessible += L
|
||||
|
||||
var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in possessible
|
||||
@@ -595,7 +575,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
to_chat(src, "<span class='warning'>This creature is too powerful for you to possess!</span>")
|
||||
return 0
|
||||
|
||||
if(can_reenter_corpse || (mind && mind.current))
|
||||
if(can_reenter_corpse && mind && mind.current)
|
||||
if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No")
|
||||
return 0
|
||||
if(target.key)
|
||||
@@ -631,7 +611,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/proc/show_server_hop_transfer_screen(expected_key)
|
||||
//only show it to incoming ghosts
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
for(var/mob/dead/observer/O in GLOB.player_list)
|
||||
if(O.key == expected_key)
|
||||
if(O.client)
|
||||
new /obj/screen/splash(O.client, TRUE)
|
||||
@@ -652,7 +632,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
var/dat
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
dat += data_core.get_manifest()
|
||||
dat += GLOB.data_core.get_manifest()
|
||||
|
||||
src << browse(dat, "window=manifest;size=387x420;can_close=1")
|
||||
|
||||
@@ -692,12 +672,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/proc/show_data_huds()
|
||||
for(var/hudtype in datahuds)
|
||||
var/datum/atom_hud/H = huds[hudtype]
|
||||
var/datum/atom_hud/H = GLOB.huds[hudtype]
|
||||
H.add_hud_to(src)
|
||||
|
||||
/mob/dead/observer/proc/remove_data_huds()
|
||||
for(var/hudtype in datahuds)
|
||||
var/datum/atom_hud/H = huds[hudtype]
|
||||
var/datum/atom_hud/H = GLOB.huds[hudtype]
|
||||
H.remove_hud_from(src)
|
||||
|
||||
/mob/dead/observer/verb/toggle_data_huds()
|
||||
@@ -742,7 +722,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
update_icon()
|
||||
|
||||
/mob/dead/observer/canUseTopic()
|
||||
/mob/dead/observer/canUseTopic(atom/movable/AM,be_close = FALSE)
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
return 1
|
||||
return
|
||||
@@ -754,11 +734,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
. = ..()
|
||||
switch(var_name)
|
||||
if("icon")
|
||||
ghostimage.icon = icon
|
||||
ghostimage_default.icon = icon
|
||||
ghostimage_simple.icon = icon
|
||||
if("icon_state")
|
||||
ghostimage.icon_state = icon_state
|
||||
ghostimage_default.icon_state = icon_state
|
||||
ghostimage_simple.icon_state = icon_state
|
||||
if("fun_verbs")
|
||||
@@ -805,7 +783,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(mob_eye.hud_used)
|
||||
LAZYINITLIST(mob_eye.observers)
|
||||
mob_eye.observers |= src
|
||||
mob_eye.hud_used.show_hud(1,src)
|
||||
mob_eye.hud_used.show_hud(mob_eye.hud_used.hud_version, src)
|
||||
observetarget = mob_eye
|
||||
|
||||
/mob/dead/observer/verb/register_pai_candidate()
|
||||
@@ -826,9 +804,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(isobserver(user) && check_rights(R_SPAWN))
|
||||
change_mob_type( /mob/living/carbon/human , null, null, TRUE) //always delmob, ghosts shouldn't be left lingering
|
||||
|
||||
/mob/dead/observer/examine(mob/user)
|
||||
..()
|
||||
if(!invisibility)
|
||||
to_chat(user, "It seems extremely obvious.")
|
||||
|
||||
/proc/set_observer_default_invisibility(amount, message=null)
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
G.invisibility = amount
|
||||
if(message)
|
||||
to_chat(G, message)
|
||||
observer_default_invisibility = amount
|
||||
GLOB.observer_default_invisibility = amount
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
|
||||
. = src.say_dead(message)
|
||||
|
||||
/mob/dead/observer/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
|
||||
/mob/dead/observer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
var/atom/movable/to_follow = speaker
|
||||
if(radio_freq)
|
||||
var/atom/movable/virtualspeaker/V = speaker
|
||||
|
||||
if(isAI(V.source))
|
||||
var/mob/living/silicon/ai/S = V.source
|
||||
speaker = S.eyeobj
|
||||
to_follow = S.eyeobj
|
||||
else
|
||||
speaker = V.source
|
||||
var/link = FOLLOW_LINK(src, speaker)
|
||||
to_follow = V.source
|
||||
var/link = FOLLOW_LINK(src, to_follow)
|
||||
// Recompose the message, because it's scrambled by default
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans)
|
||||
to_chat(src, "[link] [message]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user