Merge pull request #4030 from Fox-McCloud/advanced-camera-port

Ports Advanced Cameras
This commit is contained in:
TheDZD
2016-03-30 18:48:16 -04:00
15 changed files with 380 additions and 3 deletions
@@ -939,6 +939,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
src << "<span class='alert'>Your psy-connection grows too faint to maintain!</span>"
isRemoteObserve = 0
if(remote_view)
isRemoteObserve = 1
if(!isRemoteObserve && client && !client.adminobs)
remoteview_target = null
reset_view(null)
@@ -66,6 +66,12 @@
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
..()
/mob/living/carbon/slime/Destroy()
for(var/obj/machinery/computer/camera_advanced/xenobio/X in machines)
if(src in X.stored_slimes)
X.stored_slimes -= src
return ..()
/mob/living/carbon/slime/regenerate_icons()
icon_state = "[colour] [is_adult ? "adult" : "baby"] slime"
overlays.len = 0
+1 -1
View File
@@ -212,7 +212,7 @@
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
if(!remote_view && !client.adminobs)
reset_view(null)
/mob/living/proc/update_sight()
+2
View File
@@ -211,6 +211,8 @@
var/atom/movable/remote_control //Calls relaymove() to whatever it is
var/remote_view = 0 // Set to 1 to prevent view resets on Life
var/obj/control_object //Used by admins to possess objects. All mobs should have this var
var/datum/visibility_interface/visibility_interface = null // used by the visibility system to provide an interface for the visibility networks
@@ -492,6 +492,20 @@
feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
var/obj/item/weapon/slimesteroid2/P = new /obj/item/weapon/slimesteroid2
P.loc = get_turf(holder.my_atom)
slime_territory
name = "Slime Territory"
id = "s_territory"
result = null
required_reagents = list("blood" = 1)
result_amount = 1
required_container = /obj/item/slime_extract/cerulean
required_other = 1
on_reaction(datum/reagents/holder)
feedback_add_details("slime_cores_used","[type]")
var/obj/item/areaeditor/blueprints/slime/P = new /obj/item/areaeditor/blueprints/slime
P.forceMove(get_turf(holder.my_atom))
//Sepia
slimestop
name = "Slime Stop"
@@ -1597,6 +1597,12 @@
user.drop_item()
forceMove(get_turf(O))
return Expand()
if(istype(O, /obj/machinery/computer/camera_advanced/xenobio))
var/obj/machinery/computer/camera_advanced/xenobio/X = O
X.monkeys++
user << "<span class='notice'>You feed [src] to the [X]. It now has [X.monkeys] monkey cubes stored.</span>"
qdel(src)
return
..()
/obj/item/weapon/reagent_containers/food/snacks/monkeycube/attack_self(mob/user)
@@ -0,0 +1,171 @@
//Xenobio control console
/mob/camera/aiEye/remote/xenobio
visible_icon = 1
icon = 'icons/obj/abductor.dmi'
icon_state = "camera_target"
/mob/camera/aiEye/remote/xenobio/setLoc(var/t)
var/area/new_area = get_area(t)
if(new_area && new_area.name == "Xenobiology Lab" || istype(new_area, /area/toxins/xenobiology ))
return ..()
else
return
/obj/machinery/computer/camera_advanced/xenobio
name = "Slime management console"
desc = "A computer used for remotely handling slimes."
networks = list("SS13")
off_action = new/datum/action/camera_off/xenobio
var/datum/action/slime_place/slime_place_action = new
var/datum/action/slime_pick_up/slime_up_action = new
var/datum/action/feed_slime/feed_slime_action = new
var/datum/action/monkey_recycle/monkey_recycle_action = new
var/list/stored_slimes = list()
var/max_slimes = 5
var/monkeys = 0
icon_screen = "slime_comp"
icon_keyboard = "rd_key"
/obj/machinery/computer/camera_advanced/xenobio/CreateEye()
eyeobj = new /mob/camera/aiEye/remote/xenobio()
eyeobj.loc = get_turf(src)
eyeobj.origin = src
eyeobj.visible_icon = 1
eyeobj.icon = 'icons/obj/abductor.dmi'
eyeobj.icon_state = "camera_target"
/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/carbon/user)
off_action.target = user
off_action.Grant(user)
jump_action.target = user
jump_action.Grant(user)
slime_up_action.target = src
slime_up_action.Grant(user)
slime_place_action.target = src
slime_place_action.Grant(user)
feed_slime_action.target = src
feed_slime_action.Grant(user)
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 ..()
/datum/action/camera_off/xenobio/Activate()
if(!target || !ishuman(target))
return
var/mob/living/carbon/C = target
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/origin = remote_eye.origin
C.remote_view = 0
origin.current_user = null
origin.jump_action.Remove(C)
origin.slime_place_action.Remove(C)
origin.slime_up_action.Remove(C)
origin.feed_slime_action.Remove(C)
origin.monkey_recycle_action.Remove(C)
//All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific
remote_eye.user = null
if(C.client)
C.client.perspective = MOB_PERSPECTIVE
C.client.eye = src
C.client.images -= remote_eye.user_image
for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks)
C.client.images -= chunk.obscured
C.remote_control = null
C.unset_machine()
src.Remove(C)
/datum/action/slime_place
name = "Place Slimes"
action_type = AB_INNATE
button_icon_state = "slime_down"
/datum/action/slime_place/Activate()
if(!target || !ishuman(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(cameranet.checkTurfVis(remote_eye.loc))
for(var/mob/living/carbon/slime/S in X.stored_slimes)
S.forceMove(remote_eye.loc)
S.visible_message("[S] warps in!")
X.stored_slimes -= S
/datum/action/slime_pick_up
name = "Pick up Slime"
action_type = AB_INNATE
button_icon_state = "slime_up"
/datum/action/slime_pick_up/Activate()
if(!target || !ishuman(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(cameranet.checkTurfVis(remote_eye.loc))
for(var/mob/living/carbon/slime/S in remote_eye.loc)
if(X.stored_slimes.len >= X.max_slimes)
break
if(!S.ckey)
if(S.buckled)
S.buckled.unbuckle_mob()
S.Feedstop()
S.visible_message("[S] vanishes in a flash of light!")
S.forceMove(X)
X.stored_slimes += S
/datum/action/feed_slime
name = "Feed Slimes"
action_type = AB_INNATE
button_icon_state = "monkey_down"
/datum/action/feed_slime/Activate()
if(!target || !ishuman(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(cameranet.checkTurfVis(remote_eye.loc))
if(X.monkeys >= 1)
var/mob/living/carbon/human/monkey/food = new /mob/living/carbon/human/monkey(remote_eye.loc)
food.LAssailant = C
X.monkeys --
owner << "[X] now has [X.monkeys] monkeys left."
/datum/action/monkey_recycle
name = "Recycle Monkeys"
action_type = AB_INNATE
button_icon_state = "monkey_up"
/datum/action/monkey_recycle/Activate()
if(!target || !ishuman(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(cameranet.checkTurfVis(remote_eye.loc))
for(var/mob/living/carbon/human/M in remote_eye.loc)
if(issmall(M) && M.stat)
M.visible_message("[M] vanishes as they are reclaimed for recycling!")
X.monkeys += 0.2
qdel(M)
@@ -438,6 +438,18 @@
max_amount = 60
turf_type = /turf/simulated/floor/sepia
/obj/item/areaeditor/blueprints/slime
name = "cerulean prints"
desc = "A one use set of blueprints made of jelly like organic material. Renaming an area to 'Xenobiology Lab' will extend the reach of the management console."
color = "#2956B2"
/obj/item/areaeditor/blueprints/slime/edit_area()
. = ..()
var/area/A = get_area(src)
if(.)
for(var/turf/T in A)
T.color = "#2956B2"
qdel(src)
/turf/simulated/floor/sepia
slowdown = 2