mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-24 17:22:23 +00:00
175 lines
5.5 KiB
Plaintext
175 lines
5.5 KiB
Plaintext
//Xenobio control console
|
|
/mob/camera/aiEye/remote/xenobio
|
|
visible_icon = 1
|
|
icon = 'icons/obj/abductor.dmi'
|
|
icon_state = "camera_target"
|
|
var/allowed_area = null
|
|
|
|
/mob/camera/aiEye/remote/xenobio/New(loc)
|
|
var/area/A = get_area(loc)
|
|
allowed_area = A.name
|
|
..()
|
|
|
|
/mob/camera/aiEye/remote/xenobio/setLoc(t)
|
|
var/area/new_area = get_area(t)
|
|
if(new_area && new_area.name == allowed_area || new_area && new_area.xenobiology_compatible)
|
|
return ..()
|
|
else
|
|
return
|
|
|
|
/obj/machinery/computer/camera_advanced/xenobio
|
|
name = "Slime management console"
|
|
desc = "A computer used for remotely handling slimes."
|
|
networks = list("SS13")
|
|
circuit = /obj/item/circuitboard/xenobiology
|
|
var/datum/action/innate/slime_place/slime_place_action = new
|
|
var/datum/action/innate/slime_pick_up/slime_up_action = new
|
|
var/datum/action/innate/feed_slime/feed_slime_action = new
|
|
var/datum/action/innate/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(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)
|
|
..()
|
|
if(slime_up_action)
|
|
slime_up_action.target = src
|
|
slime_up_action.Grant(user)
|
|
actions += slime_up_action
|
|
|
|
if(slime_place_action)
|
|
slime_place_action.target = src
|
|
slime_place_action.Grant(user)
|
|
actions += slime_place_action
|
|
|
|
if(feed_slime_action)
|
|
feed_slime_action.target = src
|
|
feed_slime_action.Grant(user)
|
|
actions += feed_slime_action
|
|
|
|
if(monkey_recycle_action)
|
|
monkey_recycle_action.target = src
|
|
monkey_recycle_action.Grant(user)
|
|
actions += monkey_recycle_action
|
|
|
|
|
|
|
|
/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/reagent_containers/food/snacks/monkeycube))
|
|
monkeys++
|
|
to_chat(user, "<span class='notice'>You feed [O] to [src]. It now has [monkeys] monkey cubes stored.</span>")
|
|
user.drop_item()
|
|
qdel(O)
|
|
return
|
|
else if(istype(O, /obj/item/storage/bag))
|
|
var/obj/item/storage/P = O
|
|
var/loaded = 0
|
|
for(var/obj/item/reagent_containers/food/snacks/monkeycube/MC in P.contents)
|
|
loaded = 1
|
|
monkeys++
|
|
P.remove_from_storage(MC)
|
|
qdel(MC)
|
|
if(loaded)
|
|
to_chat(user, "<span class='notice'>You fill [src] with the monkey cubes stored in [O]. [src] now has [monkeys] monkey cubes stored.</span>")
|
|
return
|
|
..()
|
|
|
|
/datum/action/innate/slime_place
|
|
name = "Place Slimes"
|
|
button_icon_state = "slime_down"
|
|
|
|
/datum/action/innate/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
|
|
else
|
|
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
|
|
|
|
/datum/action/innate/slime_pick_up
|
|
name = "Pick up Slime"
|
|
button_icon_state = "slime_up"
|
|
|
|
/datum/action/innate/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
|
|
else
|
|
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
|
|
|
|
/datum/action/innate/feed_slime
|
|
name = "Feed Slimes"
|
|
button_icon_state = "monkey_down"
|
|
|
|
/datum/action/innate/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 --
|
|
to_chat(owner, "[X] now has [X.monkeys] monkeys left.")
|
|
else
|
|
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
|
|
|
|
/datum/action/innate/monkey_recycle
|
|
name = "Recycle Monkeys"
|
|
button_icon_state = "monkey_up"
|
|
|
|
/datum/action/innate/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 [M.p_theyre()] reclaimed for recycling!")
|
|
X.monkeys = round(X.monkeys + 0.2,0.1)
|
|
qdel(M)
|
|
else
|
|
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>") |