From db2d703f72ea0c4dc8652cbc8cafce3cf423c683 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Thu, 6 Sep 2012 02:33:30 +0000 Subject: [PATCH] -Holograms can move around again. I'm also experimenting with them being area based, meaning they can move around an area freely and lose their hologram when they leave the area. I've made it a const option, so change HOLOPAD_MODE to 0 to return it to the old system, which will destroy the hologram when it is out of range of the holopad. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4633 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/machinery.dm | 1 + code/game/machinery/hologram.dm | 28 +++++++++++++++++-- .../mob/living/silicon/ai/freelook/eye.dm | 6 ++++ html/changelog.html | 10 ++++++- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/code/defines/obj/machinery.dm b/code/defines/obj/machinery.dm index 03059344c10..e431debaf82 100644 --- a/code/defines/obj/machinery.dm +++ b/code/defines/obj/machinery.dm @@ -330,6 +330,7 @@ icon_state = "holopad0" var/mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time. var/last_request = 0 //to prevent request spam. ~Carn + var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. /obj/machinery/hologram/projector name = "hologram projector" diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 671f9a2feed..8104b8e85c3 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -12,6 +12,12 @@ Possible to do for anyone motivated enough: Itegrate EMP effect to disable the unit. */ +// HOLOPAD MODE +// 0 = RANGE BASED +// 1 = AREA BASED +var/const/HOLOPAD_MODE = 1 + + /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. if(!istype(user)) return @@ -72,7 +78,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ hologram.mouse_opacity = 0//So you can't click on it. hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. hologram.anchored = 1//So space wind cannot drag it. - hologram.name = "AI hologram"//If someone decides to right click. + hologram.name = "[A.name] (Hologram)"//If someone decides to right click. hologram.SetLuminosity(2) //hologram lighting SetLuminosity(2) //pad lighting icon_state = "holopad1" @@ -94,12 +100,28 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/machinery/hologram/holopad/process() if(hologram)//If there is a hologram. - if(master && !master.stat && master.client && master.eyeobj.loc == src.loc)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. + if(master && !master.stat && master.client && master.eyeobj)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. if(!(stat & NOPOWER))//If the machine has power. - return 1 + if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range))) + return 1 + + else if (HOLOPAD_MODE == 1) + + var/area/holo_area = get_area(src) + var/area/eye_area = get_area(master.eyeobj) + + if(eye_area in holo_area.master.related) + return 1 + clear_holo()//If not, we want to get rid of the hologram. return 1 +/obj/machinery/hologram/holopad/proc/move_hologram() + if(hologram) + step_to(hologram, master.eyeobj) // So it turns. + hologram.loc = get_turf(master.eyeobj) + return 1 + /obj/machinery/hologram/power_change() if (powered()) stat &= ~NOPOWER diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 218148ab429..ef10f4a4eaf 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -10,6 +10,7 @@ var/mob/living/silicon/ai/ai = null density = 0 nodamage = 1 // You can't damage it. + mouse_opacity = 0 // Movement code. Returns 0 to stop air movement from moving it. /mob/aiEye/Move() @@ -41,6 +42,11 @@ if(ai) if(ai.client) ai.client.eye = src + //Holopad + if(istype(ai.current, /obj/machinery/hologram/holopad)) + var/obj/machinery/hologram/holopad/H = ai.current + H.move_hologram() + // AI MOVEMENT diff --git a/html/changelog.html b/html/changelog.html index fc00a8992b6..36cfa4cc839 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -49,6 +49,15 @@ should be listed in the changelog upon commit tho. Thanks. --> +
+

6 September 2012

+

Giacom updated:

+ +
+

3 September 2012

Giacom updated:

@@ -59,7 +68,6 @@ should be listed in the changelog upon commit tho. Thanks. -->
  • Cameras get upgrades! Currently there's X-ray, EMP-Proof and Motion. You'll find the EMP-Proof and Motion cameras in the normal places (Singularity Pen & EVA), the new X-ray cameras can be found in the Dormitory and Bathrooms, plus some extra ones to invade your privacy. See if you can smash them all.
  • Alien Larva can bite simple animals (see: Ian, Runtime, Mice) to kill them and gain a small amount of growing points.
  • Space travel was tweaked to be more random when changing Z levels. This will stop people and items from being stuck in an infinite loop, as they will eventually hit something to make them stop.
  • -
  • Removed cameras from bots. They weren't working well with freelook and I felt that since they weren't used at all, they wouldn't be missed.