diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index f2d3aa05399..37642103369 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -112,7 +112,6 @@ rcd light flash thingy on matter drain else src << "Out of uses." else src << "That's not a machine." -/* /datum/AI_Module/large/place_cyborg_transformer module_name = "Robotic Factory (Removes Shunting)" @@ -140,7 +139,7 @@ rcd light flash thingy on matter drain src << "Out of uses." return - var/sure = alert(src, "Make sure the room it is in is big enough and that there is a 1x3 area for the machine. Are you sure you want to place the machine here?", "Are you sure?", "Yes", "No") + var/sure = alert(src, "Make sure the room it is in is big enough, there is camera vision and that there is a 1x3 area for the machine. Are you sure you want to place the machine here?", "Are you sure?", "Yes", "No") if(sure != "Yes") return @@ -150,6 +149,11 @@ rcd light flash thingy on matter drain var/alert_msg = "There isn't enough room. Make sure you are placing the machine in a clear area and on a floor." + var/datum/camerachunk/C = cameranet.getCameraChunk(middle.x, middle.y, middle.z) + if(!C.visibleTurfs[middle]) + alert(src, "We cannot get camera vision of this location.") + return + for(var/T in turfs) // Make sure the turfs are clear and the correct type. @@ -165,11 +169,11 @@ rcd light flash thingy on matter drain // All clear, place the transformer new /obj/machinery/transformer/conveyor(middle) + playsound(middle, 'sound/effects/phasein.ogg', 100, 1) src.can_shunt = 0 PCT.uses -= 1 src << "You cannot shunt anymore." -*/ /datum/AI_Module/small/blackout module_name = "Blackout" diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index a817c2c3a55..99074c4e835 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -1,6 +1,6 @@ /obj/machinery/transformer name = "Automatic Robotic Factory 5000" - desc = "A large metalic machine with an entrance and an exit. A sign on the side reads, 'human go in, robot come out', human must be lying down and alive." + desc = "A large metalic machine with an entrance and an exit. A sign on the side reads, 'human go in, robot come out', human must be lying down and alive. Has to cooldown between each use." icon = 'icons/obj/recycling.dmi' icon_state = "separator-AO1" layer = MOB_LAYER+1 // Overhead @@ -8,13 +8,31 @@ density = 1 var/transform_dead = 0 var/transform_standing = 0 + var/cooldown_duration = 600 // 1 minute + var/cooldown = 0 + var/robot_cell_charge = 5000 /obj/machinery/transformer/New() // On us ..() - new /obj/machinery/conveyor(loc, WEST, 1) + new /obj/machinery/conveyor/auto(loc, WEST) + +/obj/machinery/transformer/power_change() + ..() + update_icon() + +/obj/machinery/transformer/update_icon() + ..() + if(stat & (BROKEN|NOPOWER) || cooldown == 1) + icon_state = "separator-AO0" + else + icon_state = initial(icon_state) /obj/machinery/transformer/Bumped(var/atom/movable/AM) + + if(cooldown == 1) + return + // HasEntered didn't like people lying down. if(ishuman(AM)) // Only humans can enter from the west side, while lying down. @@ -27,17 +45,41 @@ /obj/machinery/transformer/proc/transform(var/mob/living/carbon/human/H) if(stat & (BROKEN|NOPOWER)) return + if(cooldown == 1) + return + if(!transform_dead && H.stat == DEAD) playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) return + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + H.emote("scream") // It is painful + H.adjustBruteLoss(max(0, 80 - H.getBruteLoss())) // Hurt the human, don't try to kill them though. + H.handle_regular_hud_updates() // Make sure they see the pain. + + // Sleep for a couple of ticks to allow the human to see the pain + sleep(5) + use_power(5000) // Use a lot of power. - var/mob/living/silicon/robot = H.Robotize() - robot.lying = 1 - spawn(50) // So he can't jump out the gate right away. + var/mob/living/silicon/robot/R = H.Robotize(1) // Delete the items or they'll all pile up in a single tile and lag + + R.cell.maxcharge = robot_cell_charge + R.cell.charge = robot_cell_charge + + // So he can't jump out the gate right away. + R.SetLockdown() + spawn(50) playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) - if(robot) - robot.lying = 0 + sleep(30) + if(R) + R.SetLockdown(0) + + // Activate the cooldown + cooldown = 1 + update_icon() + spawn(cooldown_duration) + cooldown = 0 + update_icon() /obj/machinery/transformer/conveyor/New() ..() @@ -48,9 +90,9 @@ //East var/turf/east = locate(T.x + 1, T.y, T.z) if(istype(east, /turf/simulated/floor)) - new /obj/machinery/conveyor(east, WEST, 1) + new /obj/machinery/conveyor/auto(east, WEST) // West var/turf/west = locate(T.x - 1, T.y, T.z) if(istype(west, /turf/simulated/floor)) - new /obj/machinery/conveyor(west, WEST, 1) \ No newline at end of file + new /obj/machinery/conveyor/auto(west, WEST) \ No newline at end of file diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index d5841d9fc30..b1f28299457 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -261,11 +261,14 @@ //human -> robot -/mob/living/carbon/human/proc/Robotize() +/mob/living/carbon/human/proc/Robotize(var/delete_items = 0) if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + if(delete_items) + del(W) + else + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 58973b70f38..af110da5b57 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -19,8 +19,29 @@ /obj/machinery/conveyor/centcom_auto id = "round_end_belt" + +// Auto conveyour is always on unless unpowered + +/obj/machinery/conveyor/auto/New(loc, newdir) + ..(loc, newdir) + operating = 1 + setmove() + +/obj/machinery/conveyor/auto/update() + if(stat & BROKEN) + icon_state = "conveyor-broken" + operating = 0 + return + else if(!operable) + operating = 0 + else if(stat & NOPOWER) + operating = 0 + else + operating = 1 + icon_state = "conveyor[operating]" + // create a conveyor -/obj/machinery/conveyor/New(loc, newdir, on = 0) +/obj/machinery/conveyor/New(loc, newdir) ..(loc) if(newdir) dir = newdir @@ -49,9 +70,6 @@ if(SOUTHWEST) forwards = WEST backwards = NORTH - if(on) - operating = 1 - setmove() /obj/machinery/conveyor/proc/setmove() if(operating == 1) diff --git a/html/changelog.html b/html/changelog.html index 941685193de..e79ed2a2ea1 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -49,7 +49,17 @@ Stuff which is in development and not yet visible to players or just code relate (ie. code improvements for expandability, etc.) should not be listed here. They should be listed in the changelog upon commit tho. Thanks. --> - + + + + +