Files
CHOMPStation2/code/modules/mob/dead/observer/observer_vr.dm
Arokha Sieyes cb0a9f009d Allow ghosts to enter Soulcatchers
Ghosts now have a verb "Join Into Soulcatcher" that lists all players, and they can pick one to ask them if they can join into their SC. If they don't have one, it notifies the ghost (this is less expensive than trying to crunch who has a soulcatcher and shortening the list. You can just deal with it okay??). You cannot get backed up if you joined this way, like there's no way to move from being a ghost to being in someone's head to being in a mob. You'd need to ghost and respawn normally. (This is intentional... no sneaky no-manifest people getting in).

And various other SC QOL things:
- Adds NMe and NSay verbs when you get a soulcatcher installed so you can use them in the text parser at the bottom of the window or click them in the verb list like a crazy person. The older emotes also still work.
- Prevents 'loop of madness' where both pred and prey have soulcatchers and it floods your log as it tries to decide who catches who
- Removes minds if the client is disconnected for a long time, or if the player ghosts out of the NIF
2017-12-28 16:36:43 -05:00

72 lines
2.5 KiB
Plaintext

/mob/observer/dead/verb/paialert()
set category = "Ghost"
set name = "Blank pAI alert"
set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope."
if(usr.client.prefs.be_special & BE_PAI)
for(var/obj/item/device/paicard/p in world)
var/obj/item/device/paicard/PP = p
if(PP.pai == null)
PP.icon = 'icons/obj/pda_vr.dmi'
PP.overlays += "pai-ghostalert"
spawn(54)
PP.overlays.Cut()
/mob/observer/dead/verb/nifjoin()
set category = "Ghost"
set name = "Join Into Soulcatcher"
set desc = "Select a player with a working NIF + Soulcatcher NIFSoft to join into it."
var/picked = input("Pick a friend with NIF and Soulcatcher to join into. Harrass strangers, get banned. Not everyone has a NIF w/ Soulcatcher.","Select a player") as null|anything in player_list
//Didn't pick anyone or picked a null
if(!picked)
return
//Good choice testing and some instance-grabbing
if(!ishuman(picked))
to_chat(src,"<span class='warning'>[picked] isn't in a humanoid mob at the moment.</span>")
return
var/mob/living/carbon/human/H = picked
if(H.stat || !H.client)
to_chat(src,"<span class='warning'>[H] isn't awake/alive at the moment.</span>")
return
if(!H.nif)
to_chat(src,"<span class='warning'>[H] doesn't have a NIF installed.</span>")
return
var/datum/nifsoft/soulcatcher/SC = H.nif.imp_check(NIF_SOULCATCHER)
if(!SC)
to_chat(src,"<span class='warning'>[H] doesn't have the Soulcatcher NIFSoft installed, or their NIF is unpowered.</span>")
return
//Fine fine, we can ask.
var/obj/item/device/nif/nif = H.nif
to_chat(src,"<span class='notice'>Request sent to [H].</span>")
var/req_time = world.time
nif.notify("Transient mindstate detected, analyzing...")
sleep(15) //So if they are typing they get interrupted by sound and message, and don't type over the box
var/response = alert(H,"[src] ([src.key]) wants to join into your Soulcatcher.","Soulcatcher Request","Deny","Allow")
if(response == "Deny")
to_chat(src,"<span class='warning'>[H] denied your request.</span>")
return
if((world.time - req_time) > 1 MINUTES)
to_chat(H,"<span class='warning'>The request had already expired. (1 minute waiting max)</span>")
return
//Final check since we waited for input a couple times.
if(H && src && src.key && !H.stat && nif && SC)
if(!mind) //No mind yet, aka haven't played in this round.
mind = new(key)
mind.name = name
mind.current = src
mind.active = TRUE
SC.catch_mob(src) //This will result in us being deleted so...