and finally, the modules folder. Now I can publish and take a break
This commit is contained in:
@@ -8,8 +8,9 @@
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
icon = 'icons/obj/assemblies/electronic_setups.dmi'
|
||||
icon_state = "setup_small"
|
||||
flags_1 = NOBLUDGEON_1
|
||||
item_flags = NOBLUDGEON
|
||||
materials = list() // To be filled later
|
||||
datum_flags = DF_USE_TAG
|
||||
var/list/assembly_components = list()
|
||||
var/list/ckeys_allowed_to_scan = list() // Players who built the circuit can scan it as a ghost.
|
||||
var/max_components = IC_MAX_SIZE_BASE
|
||||
@@ -30,6 +31,8 @@
|
||||
var/combat_circuits = 0 //number of combat cicuits in the assembly, used for diagnostic hud
|
||||
var/long_range_circuits = 0 //number of long range cicuits in the assembly, used for diagnostic hud
|
||||
var/prefered_hud_icon = "hudstat" // Used by the AR circuit to change the hud icon.
|
||||
var/creator // circuit creator if any
|
||||
var/static/next_assembly_id = 0
|
||||
hud_possible = list(DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_TRACK_HUD, DIAG_CIRCUIT_HUD) //diagnostic hud overlays
|
||||
max_integrity = 50
|
||||
pass_flags = 0
|
||||
@@ -56,14 +59,17 @@
|
||||
COLOR_ASSEMBLY_PURPLE
|
||||
)
|
||||
|
||||
/obj/item/electronic_assembly/GenerateTag()
|
||||
tag = "assembly_[next_assembly_id++]"
|
||||
|
||||
/obj/item/electronic_assembly/examine(mob/user)
|
||||
. = ..()
|
||||
if(can_anchor)
|
||||
to_chat(user, "<span class='notice'>The anchoring bolts [anchored ? "are" : "can be"] <b>wrenched</b> in place and the maintainence panel [opened ? "can be" : "is"] <b>screwed</b> in place.</span>")
|
||||
to_chat(user, "<span class='notice'>The anchoring bolts [anchored ? "are" : "can be"] <b>wrenched</b> in place and the maintenance panel [opened ? "can be" : "is"] <b>screwed</b> in place.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The maintainence panel [opened ? "can be" : "is"] <b>screwed</b> in place.</span>")
|
||||
to_chat(user, "<span class='notice'>The maintenance panel [opened ? "can be" : "is"] <b>screwed</b> in place.</span>")
|
||||
|
||||
if(isobserver(user) && ckeys_allowed_to_scan[user.ckey])
|
||||
if((isobserver(user) && ckeys_allowed_to_scan[user.ckey]) || IsAdminGhost(user))
|
||||
to_chat(user, "You can <a href='?src=[REF(src)];ghostscan=1'>scan</a> this circuit.");
|
||||
|
||||
/obj/item/electronic_assembly/proc/check_interactivity(mob/user)
|
||||
@@ -186,7 +192,7 @@
|
||||
return 1
|
||||
|
||||
if(href_list["ghostscan"])
|
||||
if(isobserver(usr) && ckeys_allowed_to_scan[usr.ckey])
|
||||
if((isobserver(usr) && ckeys_allowed_to_scan[usr.ckey]) || IsAdminGhost(usr))
|
||||
if(assembly_components.len)
|
||||
var/saved = "On circuit printers with cloning enabled, you may use the code below to clone the circuit:<br><br><code>[SScircuit.save_electronic_assembly(src)]</code>"
|
||||
usr << browse(saved, "window=circuit_scan;size=500x600;border=1;can_resize=1;can_close=1;can_minimize=1")
|
||||
@@ -194,6 +200,9 @@
|
||||
to_chat(usr, "<span class='warning'>The circuit is empty!</span>")
|
||||
return
|
||||
|
||||
if(!check_interactivity(usr))
|
||||
return
|
||||
|
||||
if(href_list["rename"])
|
||||
rename(usr)
|
||||
|
||||
@@ -348,6 +357,7 @@
|
||||
to_chat(user, "<span class='notice'>You slide [IC] inside [src].</span>")
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
add_allowed_scanner(user.ckey)
|
||||
investigate_log("had [IC]([IC.type]) inserted by [key_name(user)].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
add_component(IC)
|
||||
return TRUE
|
||||
@@ -387,6 +397,7 @@
|
||||
playsound(src, 'sound/items/crowbar.ogg', 50, 1)
|
||||
user.put_in_hands(IC)
|
||||
add_allowed_scanner(user.ckey)
|
||||
investigate_log("had [IC]([IC.type]) removed by [key_name(user)].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
settings to specific circuits, or for debugging purposes. It can also pulse activation pins."
|
||||
icon = 'icons/obj/assemblies/electronic_tools.dmi'
|
||||
icon_state = "debugger"
|
||||
flags_1 = CONDUCT_1 | NOBLUDGEON_1
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = NOBLUDGEON
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
var/data_to_write = null
|
||||
var/accepting_refs = FALSE
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
desc = "A combination autopainter and flash anodizer designed to give electronic assemblies a colorful, wear-resistant finish."
|
||||
icon = 'icons/obj/assemblies/electronic_tools.dmi'
|
||||
icon_state = "detailer"
|
||||
flags_1 = CONDUCT_1 | NOBLUDGEON_1
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = NOBLUDGEON
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
var/data_to_write = null
|
||||
var/accepting_refs = FALSE
|
||||
@@ -44,4 +45,4 @@
|
||||
if(!in_range(src, user))
|
||||
return
|
||||
detail_color = color_list[color_choice]
|
||||
update_icon()
|
||||
update_icon()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
var/category_text = "NO CATEGORY THIS IS A BUG" // To show up on circuit printer, and perhaps other places.
|
||||
var/removable = TRUE // Determines if a circuit is removable from the assembly.
|
||||
var/displayed_name = ""
|
||||
|
||||
|
||||
/*
|
||||
Integrated circuits are essentially modular machines. Each circuit has a specific function, and combining them inside Electronic Assemblies allows
|
||||
a creative player the means to solve many problems. Circuits are held inside an electronic assembly, and are wired using special tools.
|
||||
|
||||
@@ -209,6 +209,7 @@ D [1]/ ||
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/activate/ask_for_pin_data(mob/user) // This just pulses the pin.
|
||||
holder.investigate_log(" was manually pulsed by [key_name(user)].", INVESTIGATE_CIRCUIT)
|
||||
holder.check_then_do_work(ord,ignore_power = TRUE)
|
||||
to_chat(user, "<span class='notice'>You pulse \the [holder]'s [src] pin.</span>")
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
var/debug = FALSE // If it's upgraded and can clone, even without config settings.
|
||||
var/current_category = null
|
||||
var/cloning = FALSE // If the printer is currently creating a circuit
|
||||
var/clone_countdown = 0 // Timestamp for when to print the circuit
|
||||
var/recycling = FALSE // If an assembly is being emptied into this printer
|
||||
var/list/program // Currently loaded save, in form of list
|
||||
|
||||
@@ -29,26 +28,22 @@
|
||||
debug = TRUE
|
||||
upgraded = TRUE
|
||||
can_clone = TRUE
|
||||
fast_clone = TRUE
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
/obj/item/integrated_circuit_printer/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/material_container, list(MAT_METAL), MINERAL_MATERIAL_AMOUNT * 25, TRUE, list(/obj/item/stack, /obj/item/integrated_circuit, /obj/item/electronic_assembly))
|
||||
|
||||
/obj/item/integrated_circuit_printer/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit_printer/process()
|
||||
/obj/item/integrated_circuit_printer/proc/print_program(mob/user)
|
||||
if(!cloning)
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
if(world.time >= clone_countdown || fast_clone)
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("<span class='notice'>[src] has finished printing its assembly!</span>")
|
||||
playsound(get_turf(T), 'sound/items/poster_being_created.ogg', 50, TRUE)
|
||||
SScircuit.load_electronic_assembly(T, program)
|
||||
cloning = FALSE
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return
|
||||
visible_message("<span class='notice'>[src] has finished printing its assembly!</span>")
|
||||
playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE)
|
||||
var/obj/item/electronic_assembly/assembly = SScircuit.load_electronic_assembly(get_turf(src), program)
|
||||
assembly.creator = key_name(user)
|
||||
assembly.investigate_log("was printed by [assembly.creator].", INVESTIGATE_CIRCUIT)
|
||||
cloning = FALSE
|
||||
|
||||
/obj/item/integrated_circuit_printer/attackby(obj/item/O, mob/user)
|
||||
if(istype(O, /obj/item/disk/integrated_circuit/upgrade/advanced))
|
||||
@@ -141,7 +136,7 @@
|
||||
if(!program)
|
||||
HTML += " {[fast_clone ? "Print" : "Begin Printing"] Assembly}"
|
||||
else if(cloning)
|
||||
HTML += " <A href='?src=[REF(src)];print=cancel'>{Cancel Print}</a> - [DisplayTimeText(max(0, clone_countdown - world.time))] remaining until completion"
|
||||
HTML += " <A href='?src=[REF(src)];print=cancel'>{Cancel Print}</a>"
|
||||
else
|
||||
HTML += " <A href='?src=[REF(src)];print=print'>{[fast_clone ? "Print" : "Begin Printing"] Assembly}</a>"
|
||||
|
||||
@@ -206,6 +201,7 @@
|
||||
|
||||
if(istype(built, /obj/item/electronic_assembly))
|
||||
var/obj/item/electronic_assembly/E = built
|
||||
E.creator = key_name(usr)
|
||||
E.opened = TRUE
|
||||
E.update_icon()
|
||||
//reupdate diagnostic hud because it was put_in_hands() and not pickup()'ed
|
||||
@@ -213,6 +209,7 @@
|
||||
E.diag_hud_set_circuitcell()
|
||||
E.diag_hud_set_circuitstat()
|
||||
E.diag_hud_set_circuittracking()
|
||||
E.investigate_log("was printed by [E.creator].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
to_chat(usr, "<span class='notice'>[capitalize(built.name)] printed.</span>")
|
||||
playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE)
|
||||
@@ -226,8 +223,10 @@
|
||||
return
|
||||
switch(href_list["print"])
|
||||
if("load")
|
||||
if(cloning)
|
||||
return
|
||||
var/input = input("Put your code there:", "loading", null, null) as message | null
|
||||
if(!check_interactivity(usr))
|
||||
if(!check_interactivity(usr) || cloning)
|
||||
return
|
||||
if(!input)
|
||||
program = null
|
||||
@@ -254,7 +253,7 @@
|
||||
to_chat(usr, "<span class='notice'>Metal cost: [program["metal_cost"]].</span>")
|
||||
|
||||
if("print")
|
||||
if(!program)
|
||||
if(!program || cloning)
|
||||
return
|
||||
|
||||
if(program["requires_upgrades"] && !upgraded && !debug)
|
||||
@@ -263,12 +262,11 @@
|
||||
if(program["unsupported_circuit"] && !debug)
|
||||
to_chat(usr, "<span class='warning'>This program uses components not supported by the specified assembly. Please change the assembly type in the save file to a supported one.</span>")
|
||||
return
|
||||
else if(fast_clone || debug)
|
||||
else if(fast_clone)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
if(debug || materials.use_amount_type(program["metal_cost"], MAT_METAL))
|
||||
var/obj/item/assembly = SScircuit.load_electronic_assembly(get_turf(src), program)
|
||||
to_chat(usr, "<span class='notice'>[assembly] has been printed from the provided template!</span>")
|
||||
playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE)
|
||||
cloning = TRUE
|
||||
print_program(usr)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You need [program["metal_cost"]] metal to build that!</span>")
|
||||
else
|
||||
@@ -279,11 +277,10 @@
|
||||
var/cloning_time = round(program["metal_cost"] / 15)
|
||||
cloning_time = min(cloning_time, MAX_CIRCUIT_CLONE_TIME)
|
||||
cloning = TRUE
|
||||
clone_countdown = world.time + cloning_time
|
||||
to_chat(usr, "<span class='notice'>You begin printing a custom assembly. This will take approximately [DisplayTimeText(cloning_time)]. You can still print \
|
||||
off normal parts during this time.</span>")
|
||||
playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
addtimer(CALLBACK(src, .proc/print_program, usr), cloning_time)
|
||||
|
||||
if("cancel")
|
||||
if(!cloning || !program)
|
||||
@@ -291,7 +288,6 @@
|
||||
|
||||
to_chat(usr, "<span class='notice'>Cloning has been canceled. Metal cost has been refunded.</span>")
|
||||
cloning = FALSE
|
||||
clone_countdown = FALSE
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
materials.use_amount_type(-program["metal_cost"], MAT_METAL) //use negative amount to regain the cost
|
||||
|
||||
|
||||
Reference in New Issue
Block a user