Files
CHOMPStation2/code/modules/mob/dead/observer/observer_vr.dm
Leshana 6756c5a483 Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-03-30
# Conflicts:
#	.travis.yml
#	code/ATMOSPHERICS/components/unary/outlet_injector.dm
#	code/__defines/_planes+layers.dm
#	code/__defines/chemistry.dm
#	code/__defines/mobs.dm
#	code/_helpers/mobs.dm
#	code/_onclick/hud/robot.dm
#	code/game/area/areas.dm
#	code/game/machinery/computer/supply.dm
#	code/game/machinery/cryopod.dm
#	code/game/machinery/doors/airlock.dm
#	code/game/objects/items/devices/communicator/UI.dm
#	code/game/objects/items/devices/communicator/messaging.dm
#	code/game/sound.dm
#	code/game/supplyshuttle.dm
#	code/game/turfs/flooring/flooring_decals.dm
#	code/modules/admin/admin.dm
#	code/modules/client/preference_setup/occupation/occupation.dm
#	code/modules/events/event_container.dm
#	code/modules/mob/dead/observer/observer.dm
#	code/modules/mob/language/language.dm
#	code/modules/mob/living/carbon/human/human.dm
#	code/modules/mob/living/carbon/human/human_powers.dm
#	code/modules/mob/living/carbon/human/life.dm
#	code/modules/mob/living/carbon/human/species/species_shapeshift.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob/living/living_powers.dm
#	code/modules/mob/living/say.dm
#	code/modules/mob/living/simple_animal/animals/bear.dm
#	code/modules/mob/living/simple_animal/animals/cat.dm
#	code/modules/mob/living/simple_animal/animals/parrot.dm
#	code/modules/mob/logout.dm
#	code/modules/mob/mob_helpers.dm
#	code/modules/organs/organ.dm
#	code/modules/organs/organ_icon.dm
#	code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm
#	code/modules/reagents/reagent_containers/syringes.dm
#	code/modules/shuttles/shuttle.dm
#	html/changelogs/.all_changelog.yml
#	maps/RandomZLevels/wildwest.dm
#	maps/southern_cross/items/clothing/sc_head.dm
#	maps/southern_cross/southern_cross-1.dmm
#	vorestation.dme
2018-03-31 09:20:59 -04:00

59 lines
2.1 KiB
Plaintext

/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...