Files
Cody BrittainandGitHub 3f62424312 [MDB Ignore] [IDB Ignore] Kills off /obj/item/device (#21774)
This has zero reason to exist in our code base. We have no procs or
variables tied to this. I removed it to make future modifications
cleaner.

---------

Signed-off-by: Cody Brittain <1779662+Generalcamo@users.noreply.github.com>
2026-02-01 05:14:26 +00:00

151 lines
5.4 KiB
Plaintext

/obj/machinery/replicator
name = "alien machine"
desc = "It's some kind of pod with strange wires and gadgets all over it."
icon = 'icons/obj/robot_charger.dmi'
icon_state = "borgcharger0(old)"
density = 1
idle_power_usage = 100
active_power_usage = 1000
var/spawn_progress_time = 0
var/max_spawn_time = 50
var/last_process_time = 0
var/list/construction = list()
var/list/spawning_types = list()
var/list/stored_materials = list()
var/fail_message
/obj/machinery/replicator/Initialize()
. = ..()
var/list/viables = list(\
/obj/item/roller,\
/obj/structure/closet/crate,\
/obj/structure/closet/acloset,\
/mob/living/simple_animal/hostile/mimic,\
/mob/living/simple_animal/hostile/viscerator,\
/mob/living/simple_animal/hostile/hivebot,\
/obj/item/analyzer,\
/obj/item/camera,\
/obj/item/flash,\
/obj/item/flashlight,\
/obj/item/healthanalyzer,\
/obj/item/breath_analyzer,\
/obj/item/multitool,\
/obj/item/paicard,\
/obj/item/radio,\
/obj/item/radio/headset,\
/obj/item/radio/beacon,\
/obj/item/autopsy_scanner,\
/obj/item/bikehorn,\
/obj/item/surgery/bonesetter,\
/obj/item/material/hatchet/butch,\
/obj/item/clothing/suit/caution,\
/obj/item/clothing/head/cone,\
/obj/item/crowbar,\
/obj/item/clipboard,\
/obj/item/cell,\
/obj/item/surgery/circular_saw,\
/obj/item/material/hatchet,\
/obj/item/handcuffs,\
/obj/item/surgery/hemostat,\
/obj/item/material/knife,\
/obj/item/flame/lighter,\
/obj/item/light/bulb,\
/obj/item/light/tube,\
/obj/item/pickaxe,\
/obj/item/shovel,\
/obj/item/weldingtool,\
/obj/item/wirecutters,\
/obj/item/wrench,\
/obj/item/screwdriver,\
/obj/item/grenade/chem_grenade/cleaner,\
/obj/item/grenade/chem_grenade/metalfoam\
)
var/quantity = rand(5,15)
for(var/i=0, i<quantity, i++)
var/button_desc = "a [pick("yellow","purple","green","blue","red","orange","white")], "
button_desc += "[pick("round","square","diamond",BP_HEART,"dog","human")] shaped "
button_desc += "[pick("toggle","switch","lever","button","pad","hole")]"
var/type = pick(viables)
viables.Remove(type)
construction[button_desc] = type
fail_message = "<span class='notice'>[icon2html(src, viewers(get_turf(src)))] a [pick("loud","soft","sinister","eery","triumphant","depressing","cheerful","angry")] \
[pick("horn","beep","bing","bleep","blat","honk","hrumph","ding")] sounds and a \
[pick("yellow","purple","green","blue","red","orange","white")] \
[pick("light","dial","meter","window","protrusion","knob","antenna","swirly thing")] \
[pick("swirls","flashes","whirrs","goes schwing","blinks","flickers","strobes","lights up")] on the \
[pick("front","side","top","bottom","rear","inside")] of [src]. A [pick("slot","funnel","chute","tube")] opens up in the \
[pick("front","side","top","bottom","rear","inside")].</span>"
/obj/machinery/replicator/process()
if(spawning_types.len && powered())
spawn_progress_time += world.time - last_process_time
if(spawn_progress_time > max_spawn_time)
src.visible_message(SPAN_NOTICE("[icon2html(src, viewers(get_turf(src)))] [src] pings!"))
var/obj/source_material = pop(stored_materials)
var/spawn_type = pop(spawning_types)
var/obj/spawned_obj = new spawn_type(src.loc)
if(source_material)
if(length(source_material.name) < MAX_MESSAGE_LEN)
spawned_obj.name = "[source_material] " + spawned_obj.name
if(length(source_material.desc) < MAX_MESSAGE_LEN * 2)
if(spawned_obj.desc)
spawned_obj.desc += " It is made of [source_material]."
else
spawned_obj.desc = "It is made of [source_material]."
qdel(source_material)
spawn_progress_time = 0
max_spawn_time = rand(30,100)
if(!spawning_types.len || !stored_materials.len)
update_use_power(POWER_USE_IDLE)
icon_state = "borgcharger0(old)"
else if(prob(5))
src.visible_message(SPAN_NOTICE("[icon2html(src, viewers(get_turf(src)))] [src] [pick("clicks","whizzes","whirrs","whooshes","clanks","clongs","clonks","bangs")]."))
last_process_time = world.time
/obj/machinery/replicator/attack_hand(mob/user as mob)
interact(user)
/obj/machinery/replicator/interact(mob/user)
var/dat = "The control panel displays an incomprehensible selection of controls, many with unusual markings or text around them.<br>"
dat += "<br>"
for(var/index=1, index<=construction.len, index++)
dat += "<A href='byond://?src=[REF(src)];activate=[index]'>\[[construction[index]]\]</a><br>"
user << browse(HTML_SKELETON(dat), "window=alien_replicator")
/obj/machinery/replicator/attackby(obj/item/attacking_item, mob/user)
user.drop_from_inventory(attacking_item, src)
stored_materials.Add(attacking_item)
src.visible_message(SPAN_NOTICE("[user] inserts [attacking_item] into [src]."))
/obj/machinery/replicator/Topic(href, href_list)
if(href_list["activate"])
var/index = text2num(href_list["activate"])
if(index > 0 && index <= construction.len)
if(stored_materials.len > spawning_types.len)
if(spawning_types.len)
src.visible_message(SPAN_NOTICE("[icon2html(src, viewers(get_turf(src)))] a [pick("light","dial","display","meter","pad")] on [src]'s front [pick("blinks","flashes")] [pick("red","yellow","blue","orange","purple","green","white")]."))
else
src.visible_message(SPAN_NOTICE("[icon2html(src, viewers(get_turf(src)))] [src]'s front compartment slides shut."))
spawning_types.Add(construction[construction[index]])
spawn_progress_time = 0
update_use_power(POWER_USE_ACTIVE)
icon_state = "borgcharger1(old)"
else
src.visible_message(fail_message)