mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Merge remote-tracking branch 'bay12-upstream/master' into development
This commit is contained in:
@@ -29,6 +29,8 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
|
||||
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
|
||||
|
||||
var/obj/item/device/multitool/ghost_multitool
|
||||
incorporeal_move = 1
|
||||
|
||||
/mob/dead/observer/New(mob/body)
|
||||
@@ -74,28 +76,37 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
|
||||
mind = body.mind //we don't transfer the mind but we keep a reference to it.
|
||||
|
||||
if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position
|
||||
loc = T
|
||||
forceMove(T)
|
||||
|
||||
if(!name) //To prevent nameless ghosts
|
||||
name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
|
||||
real_name = name
|
||||
|
||||
ghost_multitool = new(src)
|
||||
..()
|
||||
|
||||
/mob/dead/observer/Destroy()
|
||||
stop_following()
|
||||
qdel(ghost_multitool)
|
||||
ghost_multitool = null
|
||||
|
||||
if (ghostimage)
|
||||
ghost_darkness_images -= ghostimage
|
||||
qdel(ghostimage)
|
||||
ghostimage = null
|
||||
updateallghostimages()
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
|
||||
|
||||
if(istype(href_list["track"],/mob))
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
else
|
||||
var/atom/target = locate(href_list["track"])
|
||||
if(istype(target))
|
||||
ManualFollow(target)
|
||||
|
||||
/mob/dead/attackby(obj/item/W, mob/user)
|
||||
if(istype(W,/obj/item/weapon/book/tome))
|
||||
@@ -151,8 +162,6 @@ Works together with spawning an observer, noted above.
|
||||
ghost.can_reenter_corpse = can_reenter_corpse
|
||||
ghost.timeofdeath = src.stat == DEAD ? src.timeofdeath : world.time
|
||||
ghost.key = key
|
||||
if(ghost.client)
|
||||
ghost.client.time_died_as_mouse = ghost.timeofdeath
|
||||
if(ghost.client && !ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
|
||||
ghost.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing!
|
||||
return ghost
|
||||
@@ -217,6 +226,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(!found_rune)
|
||||
usr << "<span class='warning'>The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you.</span>"
|
||||
return
|
||||
stop_following()
|
||||
mind.current.ajourn=0
|
||||
mind.current.key = key
|
||||
mind.current.teleop = null
|
||||
@@ -297,8 +307,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
else
|
||||
usr << "No area available."
|
||||
|
||||
usr.loc = pick(L)
|
||||
following = null
|
||||
stop_following()
|
||||
usr.forceMove(pick(L))
|
||||
|
||||
/mob/dead/observer/verb/follow(input in getmobs())
|
||||
set category = "Ghost"
|
||||
@@ -311,27 +321,30 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
// This is the ghost's follow verb with an argument
|
||||
/mob/dead/observer/proc/ManualFollow(var/atom/movable/target)
|
||||
if(!target)
|
||||
if(!target || target == following || target == src)
|
||||
return
|
||||
|
||||
var/turf/targetloc = get_turf(target)
|
||||
if(check_holy(targetloc))
|
||||
usr << "<span class='warning'>You cannot follow a mob standing on holy grounds!</span>"
|
||||
stop_following()
|
||||
following = target
|
||||
moved_event.register(following, src, /atom/movable/proc/move_to_destination)
|
||||
destroyed_event.register(following, src, /mob/dead/observer/proc/stop_following)
|
||||
|
||||
src << "<span class='notice'>Now following \the [following]</span>"
|
||||
move_to_destination(following, following.loc, following.loc)
|
||||
|
||||
/mob/dead/observer/proc/stop_following()
|
||||
if(following)
|
||||
src << "<span class='notice'>No longer following \the [following]</span>"
|
||||
moved_event.unregister(following, src)
|
||||
destroyed_event.unregister(following, src)
|
||||
following = null
|
||||
|
||||
/mob/dead/observer/move_to_destination(var/atom/movable/am, var/old_loc, var/new_loc)
|
||||
var/turf/T = get_turf(new_loc)
|
||||
if(check_holy(T))
|
||||
usr << "<span class='warning'>You cannot follow something standing on holy grounds!</span>"
|
||||
return
|
||||
if(target != src)
|
||||
if(following && following == target)
|
||||
return
|
||||
following = target
|
||||
src << "\blue Now following [target]"
|
||||
spawn(0)
|
||||
while(target && following == target && client)
|
||||
var/turf/T = get_turf(target)
|
||||
if(!T)
|
||||
break
|
||||
// To stop the ghost flickering.
|
||||
if(loc != T)
|
||||
loc = T
|
||||
sleep(15)
|
||||
..()
|
||||
|
||||
/mob/proc/check_holy(var/turf/T)
|
||||
return 0
|
||||
@@ -356,8 +369,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/turf/T = get_turf(M) //Turf of the destination mob
|
||||
|
||||
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
|
||||
src.loc = T
|
||||
following = null
|
||||
stop_following()
|
||||
forceMove(T)
|
||||
else
|
||||
src << "This mob is not located in the game world."
|
||||
/*
|
||||
@@ -385,7 +398,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "\red You are dead! You have no mind to store memory!"
|
||||
|
||||
/mob/dead/observer/Post_Incorpmove()
|
||||
following = null
|
||||
stop_following()
|
||||
|
||||
/mob/dead/observer/verb/analyze_air()
|
||||
set name = "Analyze Air"
|
||||
@@ -421,7 +434,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>Spawning as a mouse is currently disabled.</span>"
|
||||
return
|
||||
|
||||
if(!MayRespawn(1))
|
||||
if(!MayRespawn(1, ANIMAL_SPAWN_DELAY))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -429,13 +442,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>You may not spawn as a mouse on this Z-level.</span>"
|
||||
return
|
||||
|
||||
var/timedifference = world.time - client.time_died_as_mouse
|
||||
if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600)
|
||||
var/timedifference_text
|
||||
timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss")
|
||||
src << "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>"
|
||||
return
|
||||
|
||||
var/response = alert(src, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?","Squeek!","Nope!")
|
||||
if(response != "Squeek!") return //Hit the wrong key...again.
|
||||
|
||||
@@ -551,7 +557,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return bestvent
|
||||
|
||||
/mob/dead/observer/verb/view_manfiest()
|
||||
set name = "View Crew Manifest"
|
||||
set name = "Show Crew Manifest"
|
||||
set category = "Ghost"
|
||||
|
||||
var/dat
|
||||
@@ -563,12 +569,28 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
//This is called when a ghost is drag clicked to something.
|
||||
/mob/dead/observer/MouseDrop(atom/over)
|
||||
if(!usr || !over) return
|
||||
if (isobserver(usr) && usr.client && usr.client.holder && isliving(over))
|
||||
if (usr.client.holder.cmd_ghost_drag(src,over))
|
||||
if(isobserver(usr) && usr.client && isliving(over))
|
||||
var/mob/living/M = over
|
||||
// If they an admin, see if control can be resolved.
|
||||
if(usr.client.holder && usr.client.holder.cmd_ghost_drag(src,M))
|
||||
return
|
||||
// Otherwise, see if we can possess the target.
|
||||
if(usr == src && try_possession(M))
|
||||
return
|
||||
if(istype(over, /obj/machinery/drone_fabricator))
|
||||
if(try_drone_spawn(src, over))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/proc/try_possession(var/mob/living/M)
|
||||
if(!config.ghosts_can_possess_animals)
|
||||
usr << "<span class='warning'>Ghosts are not permitted to possess animals.</span>"
|
||||
return 0
|
||||
if(!M.can_be_possessed_by(src))
|
||||
return 0
|
||||
return M.do_possession(src)
|
||||
|
||||
//Used for drawing on walls with blood puddles as a spooky ghost.
|
||||
/mob/dead/verb/bloody_doodle()
|
||||
|
||||
@@ -586,12 +608,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if (usr != src)
|
||||
return 0 //something is terribly wrong
|
||||
|
||||
var/ghosts_can_write
|
||||
if(ticker.mode.name == "cult")
|
||||
if(cult.current_antagonists.len > config.cult_ghostwriter_req_cultists)
|
||||
ghosts_can_write = 1
|
||||
|
||||
if(!ghosts_can_write)
|
||||
if(!round_is_spooky())
|
||||
src << "\red The veil is not thin enough for you to do that."
|
||||
return
|
||||
|
||||
@@ -716,6 +733,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/canface()
|
||||
return 1
|
||||
|
||||
/mob/proc/can_admin_interact()
|
||||
return 0
|
||||
|
||||
/mob/dead/observer/can_admin_interact()
|
||||
return check_rights(R_ADMIN, 0, src)
|
||||
|
||||
/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"
|
||||
@@ -732,7 +755,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/proc/updateghostsight()
|
||||
if (!seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
|
||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
if (!ghostvision)
|
||||
@@ -756,7 +779,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
|
||||
mob/dead/observer/MayRespawn(var/feedback = 0)
|
||||
mob/dead/observer/MayRespawn(var/feedback = 0, var/respawn_time = 0)
|
||||
if(!client)
|
||||
return 0
|
||||
if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse)
|
||||
@@ -767,4 +790,27 @@ mob/dead/observer/MayRespawn(var/feedback = 0)
|
||||
if(feedback)
|
||||
src << "<span class='warning'>antagHUD restrictions prevent you from respawning.</span>"
|
||||
return 0
|
||||
|
||||
var/timedifference = world.time - timeofdeath
|
||||
if(respawn_time && timeofdeath && timedifference < respawn_time MINUTES)
|
||||
var/timedifference_text = time2text(respawn_time MINUTES - timedifference,"mm:ss")
|
||||
src << "<span class='warning'>You must have been dead for [respawn_time] minute\s to respawn. You have [timedifference_text] left.</span>"
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/atom/proc/extra_ghost_link()
|
||||
return
|
||||
|
||||
/mob/extra_ghost_link(var/atom/ghost)
|
||||
if(client && eyeobj)
|
||||
return "|<a href='byond://?src=\ref[ghost];track=\ref[eyeobj]'>eye</a>"
|
||||
|
||||
/mob/dead/observer/extra_ghost_link(var/atom/ghost)
|
||||
if(mind && mind.current)
|
||||
return "|<a href='byond://?src=\ref[ghost];track=\ref[mind.current]'>body</a>"
|
||||
|
||||
/proc/ghost_follow_link(var/atom/target, var/atom/ghost)
|
||||
if((!target) || (!ghost)) return
|
||||
. = "<a href='byond://?src=\ref[ghost];track=\ref[target]'>follow</a>"
|
||||
. += target.extra_ghost_link(ghost)
|
||||
|
||||
Reference in New Issue
Block a user