* Added the transforming machine to the Malf Modules.

* You have to be within camera vision to place the machine.
 * The machine has been given a minute cooldown per each use, and will look unpowered when cooling down.
 * Added a delete option for /Robotize() and used it in the machine, to stop items piling up and eventually crashing clients.
 * The machine will make a sound when placed.
 * Added auto conveyor belts which are always on unless unpowered or broken.
 * Cyborgs built from the machine will only get 5k power cells.
 * Added a changelog entry for this change.
This commit is contained in:
Giacomand
2013-08-13 23:23:37 +01:00
parent 92286e56b6
commit 784ac98de4
5 changed files with 95 additions and 19 deletions
@@ -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"
+51 -9
View File
@@ -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)
new /obj/machinery/conveyor/auto(west, WEST)
+5 -2
View File
@@ -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
+22 -4
View File
@@ -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)
+10 -1
View File
@@ -51,7 +51,16 @@ should be listed in the changelog upon commit tho. Thanks. -->
<!-- You can simply add changelogs using AddToChangelog.exe -->
<!-- DO NOT REMOVE OR MOVE THIS COMMENT! THIS MUST BE THE LAST NON-EMPTY LINE BEFORE THE LOGS #ADDTOCHANGELOGMARKER# -->␍␍
<!-- DO NOT REMOVE OR MOVE THIS COMMENT! THIS MUST BE THE LAST NON-EMPTY LINE BEFORE THE LOGS #ADDTOCHANGELOGMARKER# -->␍␍
<div class='commit sansserif'>
<h2 class='date'>13 August 2013</h2>
<h3 class='author'>Giacom updated:</h3>
<ul class='changes bgimages16'>
<li class='rscadd'>Malf AIs now have a new power which will spawn a "borging machine". This machine will turn living humans into loyal cyborgs which the AI can use to take over the station with. The AI will limit themselves by using this ability, such as no shunting, and the machine will have a long cooldown usage.</li>
</ul>
</div>
<div class='commit sansserif'>
<h2 class='date'>10 August 2013</h2>