mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
-Added a new malf module. Malf AIs can upgrade cameras to be EMP Proof and have X-Ray. Same amount of uses as reactivating cameras, same cost too.
-Cleaned up cameras a bit. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4617 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -122,7 +122,7 @@ rcd light flash thingy on matter drain
|
||||
mod_pick_name = "recam"
|
||||
uses = 10
|
||||
|
||||
/client/proc/reactivate_camera(obj/machinery/camera/C as obj in world)
|
||||
/client/proc/reactivate_camera(obj/machinery/camera/C as obj in cameranet.cameras)
|
||||
set name = "Reactivate Camera"
|
||||
set category = "Malfunction"
|
||||
if (istype (C, /obj/machinery/camera))
|
||||
@@ -138,6 +138,36 @@ rcd light flash thingy on matter drain
|
||||
else usr << "Out of uses."
|
||||
else usr << "That's not a camera."
|
||||
|
||||
/datum/AI_Module/small/upgrade_camera
|
||||
module_name = "Upgrade Camera"
|
||||
mod_pick_name = "upgradecam"
|
||||
uses = 10
|
||||
|
||||
/client/proc/upgrade_camera(obj/machinery/camera/C as obj in cameranet.cameras)
|
||||
set name = "Upgrade Camera"
|
||||
set category = "Malfunction"
|
||||
if(istype(C))
|
||||
var/datum/AI_Module/small/upgrade_camera/UC = locate(/datum/AI_Module/small/upgrade_camera) in usr:current_modules
|
||||
if(UC)
|
||||
if(UC.uses > 0)
|
||||
if(C.assembly)
|
||||
var/upgraded = 0
|
||||
if(!C.isXRay())
|
||||
C.upgradeXRay()
|
||||
cameranet.updateVisibility(C)
|
||||
upgraded = 1
|
||||
if(!C.isEmpProof())
|
||||
C.upgradeEmpProof()
|
||||
upgraded = 1
|
||||
if(upgraded)
|
||||
UC.uses --
|
||||
C.visible_message("<span class='notice'>\icon[src] *beep*</span>")
|
||||
usr << "Camera successully upgraded!"
|
||||
else
|
||||
usr << "This camera is already upgraded!"
|
||||
else
|
||||
usr << "Out of uses."
|
||||
|
||||
|
||||
/datum/AI_Module/module_picker
|
||||
var/temp = null
|
||||
@@ -152,6 +182,7 @@ rcd light flash thingy on matter drain
|
||||
src.possible_modules += new /datum/AI_Module/small/interhack
|
||||
src.possible_modules += new /datum/AI_Module/small/blackout
|
||||
src.possible_modules += new /datum/AI_Module/small/reactivate_camera
|
||||
src.possible_modules += new /datum/AI_Module/small/upgrade_camera
|
||||
|
||||
/datum/AI_Module/module_picker/proc/use(user as mob)
|
||||
var/dat
|
||||
@@ -264,6 +295,19 @@ rcd light flash thingy on matter drain
|
||||
else src.temp = "Ten additional uses added to ReCam module."
|
||||
src.processing_time -= 15
|
||||
|
||||
else if(href_list["upgradecam"])
|
||||
var/already
|
||||
for (var/datum/AI_Module/mod in usr:current_modules)
|
||||
if(istype(mod, /datum/AI_Module/small/upgrade_camera))
|
||||
mod:uses += 10
|
||||
already = 1
|
||||
if (!already)
|
||||
usr.verbs += /client/proc/upgrade_camera
|
||||
src.temp = "Upgrades a camera to have X-Ray vision and be EMP-Proof. 10 uses."
|
||||
usr:current_modules += new /datum/AI_Module/small/upgrade_camera
|
||||
else src.temp = "Ten additional uses added to ReCam module."
|
||||
src.processing_time -= 15
|
||||
|
||||
else
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
var/detectTime = 0
|
||||
var/locked = 1
|
||||
|
||||
/obj/machinery/camera/motion/New()
|
||||
..()
|
||||
assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly))
|
||||
|
||||
/obj/machinery/camera/process()
|
||||
// motion camera event loop
|
||||
@@ -49,6 +46,3 @@
|
||||
detectTime = -1
|
||||
return 1
|
||||
|
||||
/obj/machinery/camera/proc/isMotion()
|
||||
var/O = locate(/obj/item/device/assembly/prox_sensor) in assembly.upgrades
|
||||
return O
|
||||
@@ -1,10 +1,24 @@
|
||||
// PRESETS
|
||||
|
||||
/obj/machinery/camera/emp_proof/New()
|
||||
..()
|
||||
assembly.upgrades.Add(new /obj/item/stack/sheet/plasma(assembly))
|
||||
upgradeEmpProof()
|
||||
|
||||
/obj/machinery/camera/xray/New()
|
||||
..()
|
||||
assembly.upgrades.Add(new /obj/item/weapon/reagent_containers/food/snacks/grown/carrot(assembly))
|
||||
upgradeXRay()
|
||||
|
||||
/obj/machinery/camera/motion/New()
|
||||
..()
|
||||
upgradeMotion()
|
||||
|
||||
/obj/machinery/camera/all/New()
|
||||
..()
|
||||
upgradeEmpProof()
|
||||
upgradeXRay()
|
||||
upgradeMotion()
|
||||
|
||||
// CHECKS
|
||||
|
||||
/obj/machinery/camera/proc/isEmpProof()
|
||||
var/O = locate(/obj/item/stack/sheet/plasma) in assembly.upgrades
|
||||
@@ -14,8 +28,18 @@
|
||||
var/O = locate(/obj/item/weapon/reagent_containers/food/snacks/grown/carrot) in assembly.upgrades
|
||||
return O
|
||||
|
||||
/obj/machinery/camera/all/New()
|
||||
..()
|
||||
assembly.upgrades.Add(new /obj/item/stack/sheet/plasma(assembly),
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/grown/carrot(assembly),
|
||||
new /obj/item/device/assembly/prox_sensor(assembly))
|
||||
/obj/machinery/camera/proc/isMotion()
|
||||
var/O = locate(/obj/item/device/assembly/prox_sensor) in assembly.upgrades
|
||||
return O
|
||||
|
||||
// UPGRADE PROCS
|
||||
|
||||
/obj/machinery/camera/proc/upgradeEmpProof()
|
||||
assembly.upgrades.Add(new /obj/item/stack/sheet/plasma(assembly))
|
||||
|
||||
/obj/machinery/camera/proc/upgradeXRay()
|
||||
assembly.upgrades.Add(new /obj/item/weapon/reagent_containers/food/snacks/grown/carrot(assembly))
|
||||
|
||||
// If you are upgrading Motion, and it isn't in the camera's New(), add it to the machines list.
|
||||
/obj/machinery/camera/proc/upgradeMotion()
|
||||
assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly))
|
||||
Reference in New Issue
Block a user