From 08e82c56d8b27a4910cc6ff6bc2aa7e950eff0ff Mon Sep 17 00:00:00 2001 From: killer653 Date: Fri, 8 Sep 2017 22:39:55 -0400 Subject: [PATCH] Allows ghosts to click a PAI to become it. Tested and it works. --- code/_onclick/observer_vr.dm | 21 +++++++++++++++++++++ vorestation.dme | 1 + 2 files changed, 22 insertions(+) create mode 100644 code/_onclick/observer_vr.dm diff --git a/code/_onclick/observer_vr.dm b/code/_onclick/observer_vr.dm new file mode 100644 index 0000000000..b81ea955a4 --- /dev/null +++ b/code/_onclick/observer_vr.dm @@ -0,0 +1,21 @@ +/obj/item/device/paicard/attack_ghost(mob/user as mob) + if(src.pai != null) //Have a person in them already? + user.examinate(src) + return + var/choice = input(user, "You sure you want to inhabit this PAI?") in list("Yes", "No") + var/pai_name = input(user, "Choose your character's name", "Character Name") as text + var/actual_pai_name = sanitize_name(pai_name) + var/pai_key + if (isnull(pai_name)) + return + if(choice == "Yes") + pai_key = user.key + else + return + var/turf/location = get_turf(src) + var/obj/item/device/paicard/card = new(location) + var/mob/living/silicon/pai/pai = new(card) + qdel(src) + pai.key = pai_key + card.setPersonality(pai) + pai.SetName(actual_pai_name) \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 309d506309..757eda989a 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -97,6 +97,7 @@ #include "code\_onclick\drag_drop.dm" #include "code\_onclick\item_attack.dm" #include "code\_onclick\observer.dm" +#include "code\_onclick\observer_vr.dm" #include "code\_onclick\other_mobs.dm" #include "code\_onclick\rig.dm" #include "code\_onclick\telekinesis.dm"