mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +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
|
// BEGIN_INTERNALS
|
||||||
/*
|
/*
|
||||||
MAP_ICON_TYPE: 0
|
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
|
AUTO_FILE_DIR: OFF
|
||||||
*/
|
*/
|
||||||
// END_INTERNALS
|
// 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)
|
/obj/machinery/newscaster/proc/AttachPhoto(mob/user as mob)
|
||||||
if(photo)
|
if(photo)
|
||||||
photo.loc = src.loc
|
if(!issilicon(user))
|
||||||
user.put_in_inactive_hand(photo)
|
photo.loc = src.loc
|
||||||
|
user.put_in_inactive_hand(photo)
|
||||||
photo = null
|
photo = null
|
||||||
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
|
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
|
||||||
photo = user.get_active_hand()
|
photo = user.get_active_hand()
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
photo.loc = src
|
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/pda/ai/aiPDA = null
|
||||||
var/obj/item/device/multitool/aiMulti = null
|
var/obj/item/device/multitool/aiMulti = null
|
||||||
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = 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
|
var/custom_sprite = 0 //For our custom sprites
|
||||||
//Hud stuff
|
//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!'"
|
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()
|
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...
|
//Redefining some robot procs...
|
||||||
/mob/living/silicon/robot/drone/updatename()
|
/mob/living/silicon/robot/drone/updatename()
|
||||||
real_name = "maintenance drone ([rand(100,999)])"
|
real_name = "maintenance drone ([rand(100,999)])"
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
if (!master_cam)
|
if (!master_cam)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!aiCamera)
|
|
||||||
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
|
|
||||||
|
|
||||||
var/synced
|
var/synced
|
||||||
synced = 0
|
synced = 0
|
||||||
for(var/datum/picture/z in aiCamera.aipictures)
|
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/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them.
|
||||||
var/braintype = "Cyborg"
|
var/braintype = "Cyborg"
|
||||||
var/pose
|
var/pose
|
||||||
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
|
||||||
|
|
||||||
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0)
|
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0)
|
||||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
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[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||||
hud_list[IMPTRACK_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")
|
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||||
|
init()
|
||||||
|
|
||||||
if(istype(src,/mob/living/silicon/robot/drone))
|
/mob/living/silicon/robot/proc/init()
|
||||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
new/obj/item/device/camera/siliconcam/robot_camera(src)
|
||||||
else
|
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
|
||||||
|
|
||||||
// setup the PDA and its name
|
// setup the PDA and its name
|
||||||
/mob/living/silicon/robot/proc/setup_PDA()
|
/mob/living/silicon/robot/proc/setup_PDA()
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
var/speak_exclamation = "declares"
|
var/speak_exclamation = "declares"
|
||||||
var/speak_query = "queries"
|
var/speak_query = "queries"
|
||||||
|
|
||||||
|
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
||||||
|
|
||||||
/mob/living/silicon/proc/show_laws()
|
/mob/living/silicon/proc/show_laws()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
||||||
else if(toner)
|
else if(toner)
|
||||||
dat += "Please insert paper to copy.<BR><BR>"
|
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]"
|
dat += "Current toner level: [toner]"
|
||||||
if(!toner)
|
if(!toner)
|
||||||
dat +="<BR>Please insert a new toner cartridge!"
|
dat +="<BR>Please insert a new toner cartridge!"
|
||||||
@@ -112,6 +114,27 @@
|
|||||||
if(copies < maxcopies)
|
if(copies < maxcopies)
|
||||||
copies++
|
copies++
|
||||||
updateUsrDialog()
|
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)
|
attackby(obj/item/O as obj, mob/user as mob)
|
||||||
if(istype(O, /obj/item/weapon/paper))
|
if(istype(O, /obj/item/weapon/paper))
|
||||||
|
|||||||
@@ -5,10 +5,6 @@
|
|||||||
var/name = "image"
|
var/name = "image"
|
||||||
var/list/fields = list()
|
var/list/fields = list()
|
||||||
|
|
||||||
/datum/inject
|
|
||||||
var/name = "image"
|
|
||||||
var/list/fields = list()
|
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam
|
/obj/item/device/camera/siliconcam
|
||||||
var/in_camera_mode = 0
|
var/in_camera_mode = 0
|
||||||
var/photos_taken = 0
|
var/photos_taken = 0
|
||||||
@@ -20,6 +16,9 @@
|
|||||||
/obj/item/device/camera/siliconcam/robot_camera //camera cyborgs can take pictures with
|
/obj/item/device/camera/siliconcam/robot_camera //camera cyborgs can take pictures with
|
||||||
name = "Cyborg photo camera"
|
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
|
/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++
|
photos_taken++
|
||||||
P.fields["name"] = "Image [photos_taken][sufix]"
|
P.fields["name"] = "Image [photos_taken][sufix]"
|
||||||
@@ -37,6 +36,9 @@
|
|||||||
usr << "<span class='unconscious'>Image recorded</span>"
|
usr << "<span class='unconscious'>Image recorded</span>"
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam/proc/selectpicture(obj/item/device/camera/siliconcam/cam)
|
/obj/item/device/camera/siliconcam/proc/selectpicture(obj/item/device/camera/siliconcam/cam)
|
||||||
|
if(!cam)
|
||||||
|
cam = getsource()
|
||||||
|
|
||||||
var/list/nametemp = list()
|
var/list/nametemp = list()
|
||||||
var/find
|
var/find
|
||||||
if(cam.aipictures.len == 0)
|
if(cam.aipictures.len == 0)
|
||||||
@@ -50,8 +52,8 @@
|
|||||||
if(q.fields["name"] == find)
|
if(q.fields["name"] == find)
|
||||||
return q
|
return q
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam/proc/viewpictures(obj/item/device/camera/siliconcam/cam)
|
/obj/item/device/camera/siliconcam/proc/viewpictures()
|
||||||
var/datum/picture/selection = selectpicture(cam)
|
var/datum/picture/selection = selectpicture()
|
||||||
|
|
||||||
if(!selection)
|
if(!selection)
|
||||||
return
|
return
|
||||||
@@ -112,7 +114,7 @@
|
|||||||
set desc = "View images"
|
set desc = "View images"
|
||||||
set src in usr
|
set src in usr
|
||||||
|
|
||||||
viewpictures(src)
|
viewpictures()
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam/ai_camera/verb/delete_images()
|
/obj/item/device/camera/siliconcam/ai_camera/verb/delete_images()
|
||||||
set category = "AI Commands"
|
set category = "AI Commands"
|
||||||
@@ -120,7 +122,7 @@
|
|||||||
set desc = "Delete image"
|
set desc = "Delete image"
|
||||||
set src in usr
|
set src in usr
|
||||||
|
|
||||||
deletepicture(src)
|
deletepicture()
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam/robot_camera/verb/take_image()
|
/obj/item/device/camera/siliconcam/robot_camera/verb/take_image()
|
||||||
set category ="Robot Commands"
|
set category ="Robot Commands"
|
||||||
@@ -136,8 +138,7 @@
|
|||||||
set desc = "View images"
|
set desc = "View images"
|
||||||
set src in usr
|
set src in usr
|
||||||
|
|
||||||
var/obj/item/device/camera/siliconcam/cam = getsource()
|
viewpictures()
|
||||||
viewpictures(cam)
|
|
||||||
|
|
||||||
/obj/item/device/camera/siliconcam/robot_camera/verb/delete_images()
|
/obj/item/device/camera/siliconcam/robot_camera/verb/delete_images()
|
||||||
set category = "Robot Commands"
|
set category = "Robot Commands"
|
||||||
@@ -145,9 +146,13 @@
|
|||||||
set desc = "Delete a local image"
|
set desc = "Delete a local image"
|
||||||
set src in usr
|
set src in usr
|
||||||
|
|
||||||
|
// Explicitly only allow deletion from the local camera
|
||||||
deletepicture(src)
|
deletepicture(src)
|
||||||
|
|
||||||
obj/item/device/camera/siliconcam/proc/getsource()
|
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/mob/living/silicon/robot/C = src.loc
|
||||||
var/obj/item/device/camera/siliconcam/Cinfo
|
var/obj/item/device/camera/siliconcam/Cinfo
|
||||||
if(C.connected_ai)
|
if(C.connected_ai)
|
||||||
|
|||||||
Reference in New Issue
Block a user