mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Monkey Recycler Linking
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
var/cube_production = 1
|
||||
var/cycle_through = 0
|
||||
var/obj/item/reagent_containers/food/snacks/monkeycube/cube_type = /obj/item/reagent_containers/food/snacks/monkeycube
|
||||
var/list/connected = list()
|
||||
|
||||
/obj/machinery/monkey_recycler/New()
|
||||
..()
|
||||
@@ -22,6 +23,11 @@
|
||||
component_parts += new /obj/item/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/monkey_recycler/Destroy()
|
||||
for(var/obj/machinery/computer/camera_advanced/xenobio/console in connected)
|
||||
console.connected_recycler = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/monkey_recycler/RefreshParts()
|
||||
var/req_grind = 5
|
||||
@@ -47,21 +53,25 @@
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(istype(O, /obj/item/multitool))
|
||||
cycle_through++
|
||||
switch(cycle_through)
|
||||
if(1)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/farwacube
|
||||
if(2)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/wolpincube
|
||||
if(3)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/stokcube
|
||||
if(4)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/neaeracube
|
||||
if(5)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube
|
||||
cycle_through = 0
|
||||
to_chat(user, "<span class='notice'>You change the monkeycube type to [initial(cube_type.name)].</span>")
|
||||
|
||||
if(!panel_open)
|
||||
cycle_through++
|
||||
switch(cycle_through)
|
||||
if(1)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/farwacube
|
||||
if(2)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/wolpincube
|
||||
if(3)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/stokcube
|
||||
if(4)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube/neaeracube
|
||||
if(5)
|
||||
cube_type = /obj/item/reagent_containers/food/snacks/monkeycube
|
||||
cycle_through = 0
|
||||
to_chat(user, "<span class='notice'>You change the monkeycube type to [initial(cube_type.name)].</span>")
|
||||
else
|
||||
var/obj/item/multitool/M = O
|
||||
M.buffer = src
|
||||
to_chat(user, "<span class='notice'>You save the data in the [O.name]'s buffer.</span>")
|
||||
if(stat != 0) //NOPOWER etc
|
||||
return
|
||||
if(istype(O, /obj/item/grab))
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
var/monkeys = 0
|
||||
var/obj/item/slimepotion/slime/current_potion
|
||||
var/obj/item/slime_scanner/scanner = new /obj/item/slime_scanner
|
||||
var/obj/machinery/monkey_recycler/connected_recycler
|
||||
|
||||
icon_screen = "slime_comp"
|
||||
icon_keyboard = "rd_key"
|
||||
@@ -46,6 +47,16 @@
|
||||
eyeobj.icon = 'icons/obj/abductor.dmi'
|
||||
eyeobj.icon_state = "camera_target"
|
||||
|
||||
/obj/machinery/computer/camera_advanced/xenobio/Destroy()
|
||||
stored_slimes = null
|
||||
qdel(current_potion)
|
||||
qdel(scanner)
|
||||
for(var/i in contents)
|
||||
var/mob/living/simple_animal/slime/S = i
|
||||
if(istype(S))
|
||||
S.forceMove(drop_location())
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/carbon/user)
|
||||
..()
|
||||
if(slime_up_action)
|
||||
@@ -114,7 +125,7 @@
|
||||
else if (istype(O, /obj/item/slimepotion/slime))
|
||||
var/replaced = FALSE
|
||||
if(user.drop_item())
|
||||
if(!QDELETED(current_potion))
|
||||
if(current_potion)
|
||||
current_potion.forceMove(drop_location())
|
||||
replaced = TRUE
|
||||
current_potion = O
|
||||
@@ -131,6 +142,13 @@
|
||||
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
|
||||
else if (istype(O, /obj/item/multitool))
|
||||
var/obj/item/multitool/I = O
|
||||
if (istype(I.buffer, /obj/machinery/monkey_recycler))
|
||||
to_chat(user, "<span class='notice'>You link [src] with [I.buffer] in [I] buffer.</span>")
|
||||
connected_recycler = I.buffer
|
||||
connected_recycler.connected += src
|
||||
return
|
||||
..()
|
||||
|
||||
/datum/action/innate/slime_place
|
||||
@@ -207,12 +225,17 @@
|
||||
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
|
||||
|
||||
var/obj/machinery/monkey_recycler/recycler = X.connected_recycler
|
||||
|
||||
if(!recycler)
|
||||
to_chat(owner, "<span class='notice'>There is no connected monkey recycler. Use a multitool to link one.</span>")
|
||||
return
|
||||
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)
|
||||
recycler.use_power(500)
|
||||
X.monkeys = round(X.monkeys + recycler.cube_production/recycler.required_grind, 0.1)
|
||||
qdel(M)
|
||||
else
|
||||
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
|
||||
@@ -391,9 +414,13 @@
|
||||
var/mob/camera/aiEye/remote/xenobio/E = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/xenobio/X = E.origin
|
||||
var/area/mobarea = get_area(M.loc)
|
||||
|
||||
var/obj/machinery/monkey_recycler/recycler = X.connected_recycler
|
||||
if(!recycler)
|
||||
to_chat(C, "<span class='notice'>There is no connected monkey recycler. Use a multitool to link one.</span>")
|
||||
return
|
||||
if(mobarea.name == E.allowed_area || mobarea.xenobiology_compatible)
|
||||
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)
|
||||
recycler.use_power(500)
|
||||
X.monkeys = round(X.monkeys + recycler.cube_production/recycler.required_grind, 0.1)
|
||||
qdel(M)
|
||||
|
||||
Reference in New Issue
Block a user