Skip to content

Commit

Permalink
Allows more mobs to use advanced camera consoles (tgstation#24550)
Browse files Browse the repository at this point in the history
* Allows more mobs to use advanced camera consoles

Lessend mob type restrictions on advanced camera consoles, specifically
affecting drones and cyborgs.

* Remove borg adjacency check + Restrict AI

- Uncomments to AI restriction
- Removed adjacency requirement for borgs.
  • Loading branch information
GunHog authored and optimumtact committed Mar 2, 2017
1 parent 0368a01 commit 55c173b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
25 changes: 14 additions & 11 deletions code/game/machinery/computer/camera_advanced.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon_screen = "cameras"
icon_keyboard = "security_key"
var/mob/camera/aiEye/remote/eyeobj
var/mob/living/carbon/human/current_user = null
var/mob/living/current_user = null
var/list/networks = list("SS13")
var/datum/action/innate/camera_off/off_action = new
var/datum/action/innate/camera_jump/jump_action = new
Expand All @@ -13,14 +13,14 @@
eyeobj = new()
eyeobj.origin = src

/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/carbon/user)
/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/user)
off_action.target = user
off_action.Grant(user)
jump_action.target = user
jump_action.Grant(user)

/obj/machinery/computer/camera_advanced/check_eye(mob/user)
if( (stat & (NOPOWER|BROKEN)) || !Adjacent(user) || user.eye_blind || user.incapacitated() )
if( (stat & (NOPOWER|BROKEN)) || (!Adjacent(user) && !user.has_unlimited_silicon_privilege) || user.eye_blind || user.incapacitated() )
user.unset_machine()

/obj/machinery/computer/camera_advanced/Destroy()
Expand All @@ -38,11 +38,9 @@
if(current_user)
user << "The console is already in use!"
return
if(!iscarbon(user))
return
if(..())
return
var/mob/living/carbon/L = user
var/mob/living/L = user

if(!eyeobj)
CreateEye()
Expand All @@ -65,6 +63,11 @@
give_eye_control(L)
eyeobj.setLoc(eyeobj.loc)

/obj/machinery/computer/camera_advanced/attack_robot(mob/user)
return attack_hand(user)

obj/machinery/computer/camera_advanced/attack_ai(mob/user)
return //AIs would need to disable their own camera procs to use the console safely. Bugs happen otherwise.


/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user)
Expand All @@ -80,7 +83,7 @@
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
var/mob/living/carbon/human/eye_user = null
var/mob/living/eye_user = null
var/obj/machinery/computer/camera_advanced/origin
var/eye_initialized = 0
var/visible_icon = 0
Expand Down Expand Up @@ -132,9 +135,9 @@
button_icon_state = "camera_off"

/datum/action/innate/camera_off/Activate()
if(!target || !iscarbon(target))
if(!target || !isliving(target))
return
var/mob/living/carbon/C = target
var/mob/living/C = target
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
remote_eye.origin.current_user = null
remote_eye.origin.jump_action.Remove(C)
Expand All @@ -155,9 +158,9 @@
button_icon_state = "camera_jump"

/datum/action/innate/camera_jump/Activate()
if(!target || !iscarbon(target))
if(!target || !isliving(target))
return
var/mob/living/carbon/C = target
var/mob/living/C = target
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/origin = remote_eye.origin

Expand Down
28 changes: 11 additions & 17 deletions code/modules/research/xenobiology/xenobio_camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
eyeobj.icon = 'icons/obj/abductor.dmi'
eyeobj.icon_state = "camera_target"

/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/carbon/user)
/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/user)
off_action.target = user
off_action.Grant(user)

Expand All @@ -61,12 +61,6 @@
monkey_recycle_action.target = src
monkey_recycle_action.Grant(user)


/obj/machinery/computer/camera_advanced/xenobio/attack_hand(mob/user)
if(!ishuman(user)) //AIs using it might be weird
return
return ..()

/obj/machinery/computer/camera_advanced/xenobio/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
monkeys++
Expand All @@ -88,9 +82,9 @@
..()

/datum/action/innate/camera_off/xenobio/Activate()
if(!target || !ishuman(target))
if(!target || !isliving(target))
return
var/mob/living/carbon/C = target
var/mob/living/C = target
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/origin = remote_eye.origin
origin.current_user = null
Expand All @@ -116,9 +110,9 @@
button_icon_state = "slime_down"

/datum/action/innate/slime_place/Activate()
if(!target || !ishuman(owner))
if(!target || !isliving(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target

Expand All @@ -135,9 +129,9 @@
button_icon_state = "slime_up"

/datum/action/innate/slime_pick_up/Activate()
if(!target || !ishuman(owner))
if(!target || !isliving(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target

Expand All @@ -160,9 +154,9 @@
button_icon_state = "monkey_down"

/datum/action/innate/feed_slime/Activate()
if(!target || !ishuman(owner))
if(!target || !isliving(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target

Expand All @@ -181,9 +175,9 @@
button_icon_state = "monkey_up"

/datum/action/innate/monkey_recycle/Activate()
if(!target || !ishuman(owner))
if(!target || !isliving(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target

Expand Down

0 comments on commit 55c173b

Please sign in to comment.