Removes Unfinished VR (#12341)

This commit is contained in:
Fox McCloud
2019-09-20 20:58:41 -04:00
committed by variableundefined
parent 1d1e0e1fa0
commit cc151278d5
16 changed files with 3 additions and 2817 deletions
+1 -8
View File
@@ -94,14 +94,7 @@
/datum/space_chunk/proc/return_turfs()
return
/datum/space_chunk/proc/search_chunk(object_list)
var/list/located = list()
for(var/atom/object in object_list)
if(((object.x >= x) && (object.x <= (x + width))) && ((object.y >= y) && (object.y <= (y + height))) && (object.z == zpos))
located.Add(object)
return located
#undef BOTTOM_LEFT_CHUNK
#undef BOTTOM_RIGHT_CHUNK
#undef TOP_LEFT_CHUNK
#undef TOP_RIGHT_CHUNK
#undef TOP_RIGHT_CHUNK
-88
View File
@@ -1,88 +0,0 @@
/mob/living/carbon/human/virtual_reality
var/mob/living/carbon/human/real_me //The human controlling us, can be any human (including virtual ones... inception...)
var/datum/action/quit_vr/quit_action
var/datum/action/back_to_lobby/back_to_lobby
var/datum/action/detach_from_avatar/detach_from_avatar
/mob/living/carbon/human/virtual_reality/New()
quit_action = new()
quit_action.Grant(src)
back_to_lobby = new()
back_to_lobby.Grant(src)
detach_from_avatar = new()
detach_from_avatar.Grant(src)
..()
/mob/living/carbon/human/virtual_reality/death()
if(can_die())
return_to_lobby()
return ..()
/mob/living/carbon/human/virtual_reality/Destroy()
return_to_lobby()
return ..()
/mob/living/carbon/human/virtual_reality/ghost()
set category = "OOC"
set name = "Ghost"
set desc = "Relinquish your life and enter the land of the dead."
var/mob/living/carbon/human/H = real_me
revert_to_reality(FALSE)
if(H)
H.ghost()
qdel(src)
/mob/living/carbon/human/virtual_reality/proc/revert_to_reality(remove = 0)
if(real_me && mind)
mind.transfer_to(real_me)
real_me.EyeBlind(2)
real_me.Confused(2)
if(remove)
qdel(src)
else
return src
/mob/living/carbon/human/virtual_reality/proc/return_to_lobby()
if(real_me && mind)
var/mob/living/carbon/human/virtual_reality/new_vr
new_vr = spawn_vr_avatar(src, "Lobby")
var/obj/item/clothing/glasses/vr_goggles/g = new_vr.real_me.glasses
g.vr_human = new_vr
qdel(src)
/datum/action/quit_vr
name = "Quit Virtual Reality"
/datum/action/quit_vr/Trigger()
if(..())
if(istype(owner, /mob/living/carbon/human/virtual_reality))
var/mob/living/carbon/human/virtual_reality/vr = owner
vr.revert_to_reality(1)
else
Remove(owner)
/datum/action/back_to_lobby
name = "Return To Lobby"
/datum/action/back_to_lobby/Trigger()
if(..())
if(istype(owner, /mob/living/carbon/human/virtual_reality))
var/mob/living/carbon/human/virtual_reality/vr = owner
vr.return_to_lobby()
else
Remove(owner)
/datum/action/detach_from_avatar
name = "Detach From Avatar"
/datum/action/detach_from_avatar/Trigger()
if(..())
if(istype(owner, /mob/living/carbon/human/virtual_reality))
var/mob/living/carbon/human/virtual_reality/vr = owner
var/obj/item/clothing/glasses/vr_goggles/g = vr.real_me.glasses
g.vr_human = vr
vr.revert_to_reality(0)
else
Remove(owner)
-63
View File
@@ -1,63 +0,0 @@
//Control file with the backbone for the vr rooms and avatars
var/datum/vr_rooms = list()
var/roomcap = 20
/datum/vr_room
var/name = null
var/datum/map_template/vr/template = null
var/datum/space_chunk/chunk = null
var/list/spawn_points = list()
var/expires = 1
proc/make_vr_room(name, template, expires)
var/datum/vr_room/R = new
R.name = name
R.template = template
R.template = vr_templates[R.template]
R.chunk = space_manager.allocate_space(R.template.width, R.template.height)
R.expires = expires
vr_rooms[R.name] = R
R.template.load(locate(R.chunk.x,R.chunk.y,R.chunk.zpos), centered = FALSE)
for(var/atom/landmark in R.chunk.search_chunk(GLOB.landmarks_list))
if(landmark.name == "avatarspawn")
R.spawn_points.Add(landmark)
//Control code for the avatars
proc/build_virtual_avatar(mob/living/carbon/human/H, location, datum/map_template/vr/level/template)
if(!location)
return
var/mob/living/carbon/human/virtual_reality/vr_avatar
location = get_turf(location)
vr_avatar = new /mob/living/carbon/human/virtual_reality(location)
if(istype(H, /mob/living/carbon/human/virtual_reality))
var/mob/living/carbon/human/virtual_reality/V = H
vr_avatar.real_me = V.real_me
else
vr_avatar.real_me = H
vr_avatar.set_species(H.dna.species.type)
vr_avatar.dna = H.dna.Clone()
vr_avatar.name = H.name
vr_avatar.real_name = H.real_name
vr_avatar.undershirt = H.undershirt
vr_avatar.underwear = H.underwear
vr_avatar.UpdateAppearance()
vr_avatar.equipOutfit(template.outfit)
return vr_avatar
proc/control_remote(mob/living/carbon/human/H, mob/living/carbon/human/virtual_reality/vr_avatar)
if(H.mind)
H.mind.transfer_to(vr_avatar)
proc/spawn_vr_avatar(mob/living/carbon/human/H, datum/vr_room/room)
room = vr_rooms[room]
var/mob/living/carbon/human/virtual_reality/vr_human
vr_human = build_virtual_avatar(H, pick(room.spawn_points), room.template)
control_remote(H, vr_human)
return vr_human
//Preloaded rooms
/hook/roundstart/proc/starting_levels()
make_vr_room("Lobby", "lobby", 0)
return 1
-41
View File
@@ -1,41 +0,0 @@
//Glorified teleporter that puts you in a new human body.
// it's """VR"""
/obj/item/clothing/glasses/vr_goggles
desc = "A long time ago, people used these glasses to makes images from screens threedimensional."
name = "3D glasses"
icon_state = "3d"
item_state = "3d"
prescription_upgradable = 0
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
var/you_die_in_the_game_you_die_for_real = FALSE
var/mob/living/carbon/human/virtual_reality/vr_human
/obj/item/clothing/glasses/vr_goggles/Destroy()
..()
vr_human.revert_to_reality(1)
cleanup_vr_avatar()
/obj/item/clothing/glasses/vr_goggles/dropped()
..()
if(vr_human)
vr_human.revert_to_reality(0)
/obj/item/clothing/glasses/vr_goggles/proc/cleanup_vr_avatar()
if(vr_human)
vr_human = null
/obj/item/clothing/glasses/vr_goggles/equipped()
..()
var/mob/living/carbon/human/H = loc
spawn(1)
if(H.glasses == src)
if(vr_human == null)
vr_human = spawn_vr_avatar(H, "Lobby")
else
control_remote(H, vr_human)
-15
View File
@@ -1,15 +0,0 @@
//place all the outfits for your levels in here.
/datum/outfit/vr/vr_basic
name = "Basic Virtual Reality"
uniform = /obj/item/clothing/under/psysuit
shoes = /obj/item/clothing/shoes/black
/datum/outfit/vr/roman
name = "Roman"
uniform = /obj/item/clothing/under/roman
shoes = /obj/item/clothing/shoes/roman
l_hand = /obj/item/shield/riot/roman
r_hand = /obj/item/twohanded/spear
head = /obj/item/clothing/head/helmet/roman
back = /obj/item/twohanded/spear