Merge pull request #5351 from Citadel-Station-13/upstream-merge-35303

[MIRROR] Holopictures and more!
This commit is contained in:
deathride58
2018-02-07 19:10:37 +00:00
committed by GitHub
3 changed files with 56 additions and 14 deletions
+31 -3
View File
@@ -131,6 +131,7 @@
var/blueprints = 0 //are blueprints visible in the current photo being created?
var/list/aipictures = list() //Allows for storage of pictures taken by AI, in a similar manner the datacore stores info. Keeping this here allows us to share some procs w/ regualar camera
var/see_ghosts = 0 //for the spoop of it
var/obj/item/disk/holodisk/disk
/obj/item/device/camera/CheckParts(list/parts_list)
@@ -189,8 +190,24 @@
qdel(I)
pictures_left = pictures_max
return
if(istype(I, /obj/item/disk/holodisk))
if (!disk)
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return TRUE
to_chat(user, "<span class='notice'>You slide [I] into the back of [src].</span>")
disk = I
else
to_chat(user, "<span class='warning'>There's already a disk inside [src].</span>")
return TRUE //no afterattack
..()
/obj/item/device/camera/attack_self(mob/user)
if(!disk)
return
to_chat(user, "<span class='notice'>You eject [disk] out the back of [src].</span>")
user.put_in_hands(disk)
disk = null
/obj/item/device/camera/examine(mob/user)
..()
@@ -437,13 +454,24 @@
/obj/item/device/camera/afterattack(atom/target, mob/user, flag)
if(!on || !pictures_left || !isturf(target.loc))
return
if (disk)
if(ismob(target))
if (disk.record)
QDEL_NULL(disk.record)
captureimage(target, user, flag)
disk.record = new
var/mob/M = target
disk.record.caller_name = M.name
disk.record.set_caller_image(M)
else
return
else
captureimage(target, user, flag)
pictures_left--
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3)
pictures_left--
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
icon_state = "camera_off"
on = FALSE
addtimer(CALLBACK(src, .proc/cooldown), 64)