Merge pull request #6943 from PsiOmegaDelta/Ghosts

Manifest ghost visibility-toggle
This commit is contained in:
Chinsky
2014-11-07 03:46:22 +03:00
2 changed files with 41 additions and 1 deletions

View File

@@ -330,7 +330,8 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
if(istype(M,/mob/dead))
M.invisibility = 0
var/mob/dead/D = M
D.manifest()
user.visible_message( \
"\red [user] drags the ghost to our plan of reality!", \
"\red You drag the ghost to our plan of reality!" \

View File

@@ -552,3 +552,42 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 0
usr.visible_message("<span class='deadsay'><b>[src]</b> points to [A]</span>")
return 1
/mob/dead/proc/manifest()
verbs += /mob/dead/proc/toggle_visibility
toggle_visibility()
/mob/dead/proc/toggle_icon(var/icon)
if(!client)
return
var/iconRemoved = 0
for(var/image/I in client.images)
if(I.icon_state == icon)
iconRemoved = 1
del(I)
if(!iconRemoved)
var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon)
client.images += J
/mob/dead/proc/toggle_visibility()
set category = "Ghost"
set name = "Toggle Visibility"
set desc = "Allows you to turn (in)visible (almost) at will."
var/toggled_invisible
if(invisibility && world.time < toggled_invisible + 600)
src << "You must gather strength before you can turn visible again..."
return
if(invisibility == 0)
toggled_invisible = world.time
visible_message("<span class='emote'>It fades from sight...</span>", "<span class='info'>You are now invisible</span>")
else
src << "<span class='info>You are now visible</span>"
invisibility = invisibility == INVISIBILITY_OBSERVER ? 0 : INVISIBILITY_OBSERVER
// Give the ghost a cult icon which should be visible only to itself
toggle_icon("cult")