mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fixes runtime errors. AIs and cyborgs can now attach their photos to newscasters as well as photocopy them.
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
// BEGIN_INTERNALS
|
||||
/*
|
||||
MAP_ICON_TYPE: 0
|
||||
LAST_COMPILE_VERSION: 503.1224
|
||||
WINDOW: code\modules\paperwork\photography.dm;code\modules\mob\living\silicon\ai\ai.dm;code\_onclick\click.dm;code\_onclick\ai.dm;code\modules\mob\transform_procs.dm;code\game\objects\items\blueprints.dm;code\modules\paperwork\ai_photography.dm
|
||||
DIR: code code\_onclick code\game\gamemodes code\game\gamemodes\mutiny code\game\gamemodes\mutiny\directives code\game\objects code\game\objects\items code\modules code\modules\mob code\modules\mob\living code\modules\mob\living\silicon code\modules\mob\living\silicon\ai code\modules\paperwork code\WorkInProgress\AI_Visibility icons icons\mob icons\obj icons\obj\atmospherics sound sound\vox
|
||||
FILE: code\modules\paperwork\ai_photography.dm
|
||||
LAST_COMPILE_TIME: 1406556860
|
||||
AUTO_FILE_DIR: OFF
|
||||
*/
|
||||
// END_INTERNALS
|
||||
|
||||
@@ -748,16 +748,27 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
||||
|
||||
/obj/machinery/newscaster/proc/AttachPhoto(mob/user as mob)
|
||||
if(photo)
|
||||
photo.loc = src.loc
|
||||
user.put_in_inactive_hand(photo)
|
||||
if(!issilicon(user))
|
||||
photo.loc = src.loc
|
||||
user.put_in_inactive_hand(photo)
|
||||
photo = null
|
||||
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
|
||||
photo = user.get_active_hand()
|
||||
user.drop_item()
|
||||
photo.loc = src
|
||||
else if(istype(user,/mob/living/silicon))
|
||||
var/mob/living/silicon/tempAI = user
|
||||
var/obj/item/device/camera/siliconcam/camera = tempAI.aiCamera
|
||||
|
||||
if(!camera)
|
||||
return
|
||||
var/datum/picture/selection = camera.selectpicture()
|
||||
if (!selection)
|
||||
return
|
||||
|
||||
|
||||
var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
|
||||
P.construct(selection)
|
||||
photo = P
|
||||
|
||||
|
||||
//########################################################################################################################
|
||||
|
||||
@@ -32,7 +32,6 @@ var/list/ai_list = list()
|
||||
var/obj/item/device/pda/ai/aiPDA = null
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null
|
||||
var/obj/item/device/camera/siliconcam/aiCamera = null
|
||||
var/custom_sprite = 0 //For our custom sprites
|
||||
//Hud stuff
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/drone/init()
|
||||
new/obj/item/device/camera/siliconcam/drone_camera(src)
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/updatename()
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
if (!master_cam)
|
||||
return
|
||||
|
||||
if(!aiCamera)
|
||||
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
|
||||
|
||||
var/synced
|
||||
synced = 0
|
||||
for(var/datum/picture/z in aiCamera.aipictures)
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them.
|
||||
var/braintype = "Cyborg"
|
||||
var/pose
|
||||
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
||||
|
||||
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0)
|
||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
@@ -139,11 +138,11 @@
|
||||
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
init()
|
||||
|
||||
if(istype(src,/mob/living/silicon/robot/drone))
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
else
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
/mob/living/silicon/robot/proc/init()
|
||||
new/obj/item/device/camera/siliconcam/robot_camera(src)
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
|
||||
// setup the PDA and its name
|
||||
/mob/living/silicon/robot/proc/setup_PDA()
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
var/speak_exclamation = "declares"
|
||||
var/speak_query = "queries"
|
||||
|
||||
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
||||
|
||||
/mob/living/silicon/proc/show_laws()
|
||||
return
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
||||
else if(toner)
|
||||
dat += "Please insert paper to copy.<BR><BR>"
|
||||
if(istype(user,/mob/living/silicon))
|
||||
dat += "<a href='byond://?src=\ref[src];aipic=1'>Print photo from database</a><BR><BR>"
|
||||
dat += "Current toner level: [toner]"
|
||||
if(!toner)
|
||||
dat +="<BR>Please insert a new toner cartridge!"
|
||||
@@ -112,6 +114,27 @@
|
||||
if(copies < maxcopies)
|
||||
copies++
|
||||
updateUsrDialog()
|
||||
else if(href_list["aipic"])
|
||||
if(!istype(usr,/mob/living/silicon)) return
|
||||
if(toner >= 5)
|
||||
var/mob/living/silicon/tempAI = usr
|
||||
var/obj/item/device/camera/siliconcam/camera = tempAI.aiCamera
|
||||
|
||||
if(!camera)
|
||||
return
|
||||
var/datum/picture/selection = camera.selectpicture()
|
||||
if (!selection)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/photo/p = new /obj/item/weapon/photo (src.loc)
|
||||
p.construct(selection)
|
||||
if (p.desc == "")
|
||||
p.desc += "Copied by [tempAI.name]"
|
||||
else
|
||||
p.desc += " - Copied by [tempAI.name]"
|
||||
toner -= 5
|
||||
sleep(15)
|
||||
updateUsrDialog()
|
||||
|
||||
attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/paper))
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
var/name = "image"
|
||||
var/list/fields = list()
|
||||
|
||||
/datum/inject
|
||||
var/name = "image"
|
||||
var/list/fields = list()
|
||||
|
||||
/obj/item/device/camera/siliconcam
|
||||
var/in_camera_mode = 0
|
||||
var/photos_taken = 0
|
||||
@@ -20,6 +16,9 @@
|
||||
/obj/item/device/camera/siliconcam/robot_camera //camera cyborgs can take pictures with
|
||||
name = "Cyborg photo camera"
|
||||
|
||||
/obj/item/device/camera/siliconcam/drone_camera //currently doesn't offer the verbs, thus cannot be used
|
||||
name = "Drone photo camera"
|
||||
|
||||
/obj/item/device/camera/siliconcam/proc/injectaialbum(var/datum/picture/P, var/sufix = "") //stores image information to a list similar to that of the datacore
|
||||
photos_taken++
|
||||
P.fields["name"] = "Image [photos_taken][sufix]"
|
||||
@@ -37,6 +36,9 @@
|
||||
usr << "<span class='unconscious'>Image recorded</span>"
|
||||
|
||||
/obj/item/device/camera/siliconcam/proc/selectpicture(obj/item/device/camera/siliconcam/cam)
|
||||
if(!cam)
|
||||
cam = getsource()
|
||||
|
||||
var/list/nametemp = list()
|
||||
var/find
|
||||
if(cam.aipictures.len == 0)
|
||||
@@ -50,8 +52,8 @@
|
||||
if(q.fields["name"] == find)
|
||||
return q
|
||||
|
||||
/obj/item/device/camera/siliconcam/proc/viewpictures(obj/item/device/camera/siliconcam/cam)
|
||||
var/datum/picture/selection = selectpicture(cam)
|
||||
/obj/item/device/camera/siliconcam/proc/viewpictures()
|
||||
var/datum/picture/selection = selectpicture()
|
||||
|
||||
if(!selection)
|
||||
return
|
||||
@@ -112,7 +114,7 @@
|
||||
set desc = "View images"
|
||||
set src in usr
|
||||
|
||||
viewpictures(src)
|
||||
viewpictures()
|
||||
|
||||
/obj/item/device/camera/siliconcam/ai_camera/verb/delete_images()
|
||||
set category = "AI Commands"
|
||||
@@ -120,7 +122,7 @@
|
||||
set desc = "Delete image"
|
||||
set src in usr
|
||||
|
||||
deletepicture(src)
|
||||
deletepicture()
|
||||
|
||||
/obj/item/device/camera/siliconcam/robot_camera/verb/take_image()
|
||||
set category ="Robot Commands"
|
||||
@@ -136,8 +138,7 @@
|
||||
set desc = "View images"
|
||||
set src in usr
|
||||
|
||||
var/obj/item/device/camera/siliconcam/cam = getsource()
|
||||
viewpictures(cam)
|
||||
viewpictures()
|
||||
|
||||
/obj/item/device/camera/siliconcam/robot_camera/verb/delete_images()
|
||||
set category = "Robot Commands"
|
||||
@@ -145,9 +146,13 @@
|
||||
set desc = "Delete a local image"
|
||||
set src in usr
|
||||
|
||||
// Explicitly only allow deletion from the local camera
|
||||
deletepicture(src)
|
||||
|
||||
obj/item/device/camera/siliconcam/proc/getsource()
|
||||
if(istype(src.loc, /mob/living/silicon/ai))
|
||||
return src
|
||||
|
||||
var/mob/living/silicon/robot/C = src.loc
|
||||
var/obj/item/device/camera/siliconcam/Cinfo
|
||||
if(C.connected_ai)
|
||||
|
||||
Reference in New Issue
Block a user