Avatar code working

This commit is contained in:
Warior4356
2017-03-20 17:34:40 -07:00
parent 6e4f027e50
commit ef9ad52706
9 changed files with 288 additions and 1 deletions
+81
View File
@@ -0,0 +1,81 @@
"a" = (/turf/space,/area/space)
"b" = (/turf/unsimulated/wall/metal,/area/space)
"c" = (/turf/simulated/floor/bluegrid{icon_state = "dark"; name = "Mainframe Floor"; nitrogen = 100; oxygen = 0; temperature = 80},/area/space)
"d" = (/turf/unsimulated/wall/fakeglass{dir = 8; icon_state = "fakewindows3"; tag = "icon-fakewindows (WEST)"},/area/space)
"e" = (/turf/simulated/floor/greengrid,/area/space)
"f" = (/turf/simulated/floor/bluegrid{name = "Mainframe Base"; nitrogen = 100; oxygen = 0; temperature = 80},/area/space)
"g" = (/obj/machinery/telecomms/hub/preset_cent,/turf/simulated/floor/bluegrid{icon_state = "dark"; name = "Mainframe Floor"; nitrogen = 100; oxygen = 0; temperature = 80},/area/space)
"h" = (/turf/simulated/floor/light,/area/space)
"i" = (/turf/unsimulated/wall/fakeglass{dir = 1; icon_state = "fakewindows"; tag = "icon-fakewindows (WEST)"},/area/space)
"j" = (/turf/unsimulated/wall/fakeglass{dir = 0; icon_state = "fakewindows"; tag = "icon-fakewindows (EAST)"},/area/space)
"k" = (/obj/machinery/telecomms/server/presets/centcomm,/turf/simulated/floor/greengrid,/area/space)
"l" = (/obj/machinery/telecomms/relay/preset/centcom,/turf/simulated/floor/greengrid,/area/space)
"m" = (/obj/machinery/computer/mecha,/turf/simulated/floor/bluegrid{icon_state = "dark"; name = "Mainframe Floor"; nitrogen = 100; oxygen = 0; temperature = 80},/area/space)
"n" = (/obj/machinery/telecomms/processor/preset_cent,/turf/simulated/floor/bluegrid{icon_state = "dark"; name = "Mainframe Floor"; nitrogen = 100; oxygen = 0; temperature = 80},/area/space)
"o" = (/turf/unsimulated/wall/fakeglass{icon_state = "fakewindows"; dir = 8},/area/space)
"p" = (/turf/unsimulated/wall/fakeglass{tag = "icon-fakewindows (EAST)"; icon_state = "f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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
"}
+1
View File
@@ -40,6 +40,7 @@ var/list/prisonwarped = list() //list of players already warped
var/list/blobstart = list()
var/list/ninjastart = list()
var/list/carplist = list() //list of all carp-spawn landmarks
var/list/avatarspawn = list()
//away missions
var/list/awaydestinations = list() //a list of landmarks that the warpgate can take you to
+21
View File
@@ -0,0 +1,21 @@
/datum/map_template/vr
//name = "A Chest of Doubloons"
name = null
var/id = null // For blacklisting purposes, all vr levels need an id
var/description = "In the middle of a clearing in the rockface, there's a \
chest filled with gold coins with Spanish engravings. How is there a \
wooden container filled with 18th century coinage in the middle of a \
lavawracked hellscape? It is clearly a mystery."
var/cost = null
var/allow_duplicates = TRUE //A bit boring, don't you think? You can always explicitly allow it on a ruin definition
var/prefix = null
var/suffix = null
/datum/map_template/vr/New()
if(!name && id)
name = id
mappath = prefix + suffix
..(path = mappath)
+12
View File
@@ -0,0 +1,12 @@
//The bigger ones lag like hell if there is more than one on a z-level, so cost 2 for them
/datum/map_template/vr/level
prefix = "_maps/map_files/templates/vr/"
cost = 1
/datum/map_template/vr/level/lobby
id = "lobby"
suffix = "lobby.dmm"
name = "Biological Storage Facility"
description = "This is the lobby. The hub for all things VR."
cost = 2
@@ -0,0 +1,35 @@
/obj/machinery/computer/vr_control
name = "crew monitoring computer"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_screen = "comm_logs"
light_color = LIGHT_COLOR_DARKGREEN
/obj/machinery/computer/vr_control/New()
vr_control = new(src)
..()
/obj/machinery/computer/vr_control/Destroy()
qdel(vr_control)
return ..()
/obj/machinery/computer/vr_control/attack_ai(mob/user)
attack_hand(user)
ui_interact(user)
/obj/machinery/computer/vr_control/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
ui_interact(user)
/obj/machinery/computer/vr_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
//crew_monitor.ui_interact(user, ui_key, ui, force_open)
/obj/machinery/computer/vr_control/interact(mob/user)
//crew_monitor.ui_interact(user)
/obj/machinery/computer/vr_control/proc/loadlevel(template)
var/datum/space_chunk/C = zlev_manager.allocate_space(template.width, template.height)
+5 -1
View File
@@ -20,6 +20,10 @@
wizardstart += loc
qdel(src)
if("avatarspawn")
avatarspawn += loc
qdel(src)
if("JoinLate")
latejoin += loc
qdel(src)
@@ -251,7 +255,7 @@
new /obj/item/clothing/mask/gas/sexymime(src.loc)
new /obj/item/clothing/under/sexymime(src.loc)
qdel(src)
/obj/effect/landmark/ruin
var/datum/map_template/ruin/ruin_template
+54
View File
@@ -0,0 +1,54 @@
/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/obj/item/clothing/glasses/vr_goggles
var/datum/action/quit_vr/quit_action
/mob/living/carbon/human/virtual_reality/New()
quit_action = new()
quit_action.Grant(src)
..()
/mob/living/carbon/human/virtual_reality/death()
revert_to_reality()
qdel(src)
..()
/mob/living/carbon/human/virtual_reality/Destroy()
revert_to_reality()
qdel(src)
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, FALSE)
if(H)
H.ghost()
qdel(src)
/mob/living/carbon/human/virtual_reality/proc/revert_to_reality(refcleanup = TRUE, deathchecks = TRUE)
if(real_me && mind)
mind.transfer_to(real_me)
real_me.eye_blind = 4
real_me.confused = 4
// if(deathchecks && vr_sleeper && vr_sleeper.you_die_in_the_game_you_die_for_real)
// real_me.death(0)
if(refcleanup)
real_me = null
/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(FALSE, FALSE)
else
Remove(owner)
qdel(src)
+74
View File
@@ -0,0 +1,74 @@
//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
species_fit = list("Vox")
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
var/static/list/available_vr_spawnpoints
var/vr_category = "default" //Specific category of spawn points to pick from
var/outfit = /datum/outfit/vr_basic
/obj/item/clothing/glasses/vr_goggles/Destroy()
..()
cleanup_vr_avatar()
/obj/item/clothing/glasses/vr_goggles/emag_act(mob/user)
//placeholder
/obj/item/clothing/glasses/vr_goggles/dropped()
..()
if(vr_human)
cleanup_vr_avatar()
vr_human.revert_to_reality(FALSE, FALSE)
/obj/item/clothing/glasses/vr_goggles/equipped()
..()
var/mob/living/carbon/human/H = loc
spawn(1)
if(H.glasses == src)
control_remote(H,build_virtual_avatar(H,pick(avatarspawn)))
/obj/item/clothing/glasses/vr_goggles/proc/build_virtual_avatar(mob/living/carbon/human/virtual_reality/H, location)
if(!location)
return
var/mob/living/carbon/human/virtual_reality/vr_avatar
cleanup_vr_avatar()
vr_avatar = new /mob/living/carbon/human/virtual_reality(location)
vr_avatar.set_species(H.species.name)
vr_avatar.vr_goggles = src
vr_avatar.real_me = H
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.change_hair(H.head_organ.h_style)
if(outfit)
var/datum/outfit/vr_basic/O = new outfit()
O.equip(vr_avatar)
return vr_avatar
/obj/item/clothing/glasses/vr_goggles/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)
/obj/item/clothing/glasses/vr_goggles/proc/cleanup_vr_avatar()
if(vr_human)
vr_human.death(0)
/datum/outfit/vr_basic
name = "basic vr"
uniform = /obj/item/clothing/under/psysuit
shoes = /obj/item/clothing/shoes/black
+5
View File
@@ -217,6 +217,7 @@
#include "code\datums\supplypacks.dm"
#include "code\datums\uplink_item.dm"
#include "code\datums\vision_override.dm"
#include "code\datums\vr.dm"
#include "code\datums\cache\air_alarm.dm"
#include "code\datums\cache\apc.dm"
#include "code\datums\cache\cache.dm"
@@ -315,6 +316,7 @@
#include "code\datums\spells\trigger.dm"
#include "code\datums\spells\turf_teleport.dm"
#include "code\datums\spells\wizard.dm"
#include "code\datums\vr\level.dm"
#include "code\datums\weather\weather.dm"
#include "code\datums\weather\weather_types.dm"
#include "code\datums\wires\airlock.dm"
@@ -599,6 +601,7 @@
#include "code\game\machinery\computer\store.dm"
#include "code\game\machinery\computer\syndicate_specops_shuttle.dm"
#include "code\game\machinery\computer\telecrystalconsoles.dm"
#include "code\game\machinery\computer\vr_control.dm"
#include "code\game\machinery\doors\airlock.dm"
#include "code\game\machinery\doors\airlock_control.dm"
#include "code\game\machinery\doors\airlock_electronics.dm"
@@ -2160,6 +2163,8 @@
#include "code\modules\vehicle\speedbike.dm"
#include "code\modules\vehicle\sportscar.dm"
#include "code\modules\vehicle\vehicle.dm"
#include "code\modules\VR\vr_avatar.dm"
#include "code\modules\VR\vr_goggles.dm"
#include "goon\code\datums\browserOutput.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"