diff --git a/_maps/map_files/Birdshot/birdshot.dmm b/_maps/map_files/Birdshot/birdshot.dmm index 052aee9740c..0711e8dc96a 100644 --- a/_maps/map_files/Birdshot/birdshot.dmm +++ b/_maps/map_files/Birdshot/birdshot.dmm @@ -32991,15 +32991,10 @@ /turf/open/floor/iron, /area/station/security/checkpoint/escape) "lLq" = ( -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/machinery/firealarm/directional/east, /obj/effect/decal/cleanable/oil, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "lLr" = ( @@ -37938,13 +37933,10 @@ /turf/open/floor/circuit/telecomms/mainframe, /area/station/science/xenobiology) "nyf" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners, /obj/machinery/camera/autoname/directional/east, /obj/effect/decal/cleanable/dirt, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/structure/table, +/obj/item/food/cornchips/green, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "nyi" = ( diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index ff106565a42..7ab412a4f3d 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -10151,12 +10151,9 @@ /turf/open/floor/iron/dark, /area/station/command/heads_quarters/hop) "cwd" = ( -/obj/effect/turf_decal/box/corners, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/machinery/light/directional/south, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "cwe" = ( @@ -39286,15 +39283,15 @@ /turf/open/floor/iron/white, /area/station/command/heads_quarters/cmo) "jKY" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, /obj/effect/decal/cleanable/oil/streak, /obj/machinery/camera/directional/south, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/structure/table, +/obj/item/storage/toolbox/mechanical{ + pixel_y = 7 + }, +/obj/item/reagent_containers/cup/soda_cans/space_mountain_wind{ + pixel_x = 5 + }, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "jLa" = ( @@ -86574,10 +86571,6 @@ dir = 1 }, /obj/effect/decal/cleanable/dirt/dust, -/obj/item/storage/toolbox/mechanical{ - pixel_x = -8; - pixel_y = 17 - }, /obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, /obj/structure/cable, /obj/machinery/holopad, diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm index 6aa6f438643..172a001020e 100644 --- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm +++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm @@ -10091,15 +10091,10 @@ /area/mine/laborcamp) "cWa" = ( /obj/machinery/light_switch/directional/west, -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/effect/decal/cleanable/cobweb, /obj/effect/decal/cleanable/dirt/dust, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "cWq" = ( @@ -62098,11 +62093,7 @@ /turf/open/floor/plating/snowed/icemoon, /area/icemoon/underground/explored) "sVW" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/effect/decal/cleanable/dirt/dust, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "sWl" = ( diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index f0550cb5fed..c4a4756f915 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -3343,16 +3343,9 @@ /turf/open/floor/iron, /area/station/hallway/primary/starboard) "bje" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, /obj/effect/decal/cleanable/oil/streak, /obj/machinery/atmospherics/components/unary/vent_pump/on/layer4, /obj/structure/extinguisher_cabinet/directional/north, -/obj/effect/landmark/bitrunning/station_reward_spawn, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "bjl" = ( @@ -29712,14 +29705,11 @@ /turf/open/floor/engine, /area/station/science/explab) "kHU" = ( -/obj/effect/turf_decal/box/corners, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/effect/decal/cleanable/dirt/dust, /obj/machinery/light_switch/directional/north, /obj/effect/decal/cleanable/dirt/dust, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "kIG" = ( diff --git a/_maps/map_files/NorthStar/north_star.dmm b/_maps/map_files/NorthStar/north_star.dmm index 535f37974ba..60ccea505c0 100644 --- a/_maps/map_files/NorthStar/north_star.dmm +++ b/_maps/map_files/NorthStar/north_star.dmm @@ -17161,9 +17161,6 @@ /obj/item/cigbutt/cigarbutt{ pixel_x = 7 }, -/obj/effect/turf_decal/stripes{ - dir = 8 - }, /obj/machinery/atmospherics/components/unary/vent_scrubber/on/layer2{ dir = 1 }, @@ -34844,12 +34841,10 @@ /turf/open/floor/pod/light, /area/station/maintenance/floor1/starboard/fore) "jhP" = ( -/obj/effect/turf_decal/box/corners, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/effect/decal/cleanable/dirt/dust, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/effect/turf_decal/stripes{ + dir = 8 + }, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "jhU" = ( @@ -50980,9 +50975,6 @@ /obj/structure/cable, /obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, /obj/effect/turf_decal/trimline/brown/line, -/obj/effect/turf_decal/stripes/corner{ - dir = 8 - }, /obj/structure/disposalpipe/segment{ dir = 4 }, @@ -55648,11 +55640,13 @@ }, /obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, /obj/structure/cable, -/obj/effect/turf_decal/stripes, /obj/effect/turf_decal/trimline/brown/line, /obj/structure/disposalpipe/segment{ dir = 5 }, +/obj/effect/turf_decal/stripes/corner{ + dir = 8 + }, /turf/open/floor/iron/dark/smooth_half, /area/station/bitrunning/den) "owo" = ( @@ -78519,16 +78513,11 @@ /turf/open/floor/iron, /area/station/hallway/floor2/aft) "uDm" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, /obj/machinery/firealarm/directional/south, /obj/machinery/light/directional/south, /obj/effect/decal/cleanable/oil/streak, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "uDr" = ( diff --git a/_maps/map_files/debug/runtimestation.dmm b/_maps/map_files/debug/runtimestation.dmm index 3b86ffcfc20..dff02b2abd7 100644 --- a/_maps/map_files/debug/runtimestation.dmm +++ b/_maps/map_files/debug/runtimestation.dmm @@ -2184,7 +2184,7 @@ /turf/open/floor/iron, /area/station/command/bridge) "FW" = ( -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, /turf/open/floor/circuit/green, /area/station/bitrunning/den) "Ht" = ( @@ -3196,7 +3196,7 @@ aa aa aa uI -FW +hU hU jR Oq @@ -3288,8 +3288,8 @@ aa aa aa uI -FW hU +FW jR Oq uI diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index 638f7512d67..9ce8d37d988 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -42017,14 +42017,9 @@ /turf/open/floor/iron/white, /area/station/science/lobby) "nUF" = ( -/obj/effect/turf_decal/box/corners, -/obj/effect/turf_decal/box/corners{ - dir = 4 - }, /obj/effect/decal/cleanable/dirt/dust, /obj/machinery/light/directional/north, /obj/machinery/atmospherics/components/unary/vent_scrubber/on/layer2, -/obj/effect/landmark/bitrunning/station_reward_spawn, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "nUM" = ( @@ -45391,17 +45386,12 @@ /turf/open/floor/plating, /area/station/commons/vacant_room) "plH" = ( -/obj/effect/turf_decal/box/corners{ - dir = 8 - }, -/obj/effect/turf_decal/box/corners{ - dir = 1 - }, /obj/effect/decal/cleanable/oil/streak, /obj/structure/sign/poster/random/directional/north, /obj/machinery/power/apc/auto_name/directional/west, /obj/structure/cable, -/obj/effect/landmark/bitrunning/station_reward_spawn, +/obj/machinery/byteforge, +/obj/effect/turf_decal/box, /turf/open/floor/iron/dark/smooth_large, /area/station/bitrunning/den) "plQ" = ( diff --git a/code/__DEFINES/dcs/signals/signals_bitrunning.dm b/code/__DEFINES/dcs/signals/signals_bitrunning.dm index 3d008449ee7..957e61ae303 100644 --- a/code/__DEFINES/dcs/signals/signals_bitrunning.dm +++ b/code/__DEFINES/dcs/signals/signals_bitrunning.dm @@ -29,3 +29,6 @@ /// from /obj/machinery/quantum_server/refreshParts(): (servo rating) #define COMSIG_BITRUNNER_SERVER_UPGRADED "bitrunner_server_upgraded" + +/// from /obj/machinery/quantum_server/scrub_vdom() +#define COMSIG_BITRUNNER_DOMAIN_SCRUBBED "bitrunner_domain_scrubbed" diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 0338da6b4fa..79efe62a225 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -605,8 +605,3 @@ name = "Medical Order" greyscale_colors = CIRCUIT_COLOR_SUPPLY build_path = /obj/machinery/computer/department_orders/medical - -/obj/item/circuitboard/computer/quantum_console - name = "Quantum Server Console" - greyscale_colors = CIRCUIT_COLOR_SUPPLY - build_path = /obj/machinery/computer/quantum_console diff --git a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm index 4bea5b1335c..9ca1095ee4b 100644 --- a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm @@ -1529,21 +1529,3 @@ /obj/item/stack/sheet/plasteel = 2, ) -/obj/item/circuitboard/machine/quantum_server - name = "Quantum Server" - greyscale_colors = CIRCUIT_COLOR_SUPPLY - build_path = /obj/machinery/quantum_server - req_components = list( - /datum/stock_part/servo = 2, - /datum/stock_part/scanning_module = 1, - /datum/stock_part/capacitor = 1, - ) - -/obj/item/circuitboard/machine/netpod - name = "Netpod" - greyscale_colors = CIRCUIT_COLOR_SUPPLY - build_path = /obj/machinery/netpod - req_components = list( - /datum/stock_part/servo = 1, - /datum/stock_part/matter_bin = 2, - ) diff --git a/code/modules/bitrunning/components/avatar_connection.dm b/code/modules/bitrunning/components/avatar_connection.dm index 2a151d05066..24f42d8f3e5 100644 --- a/code/modules/bitrunning/components/avatar_connection.dm +++ b/code/modules/bitrunning/components/avatar_connection.dm @@ -68,7 +68,7 @@ /datum/component/avatar_connection/RegisterWithParent() ADD_TRAIT(parent, TRAIT_TEMPORARY_BODY, REF(src)) RegisterSignal(parent, COMSIG_BITRUNNER_SAFE_DISCONNECT, PROC_REF(on_safe_disconnect)) - RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection), override = TRUE) + RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection)) RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_linked_damage)) /datum/component/avatar_connection/UnregisterFromParent() @@ -79,7 +79,9 @@ /// Disconnects the avatar and returns the mind to the old_body. /datum/component/avatar_connection/proc/full_avatar_disconnect(forced = FALSE, datum/source) +#ifndef UNIT_TESTS return_to_old_body() +#endif var/obj/machinery/netpod/hosting_netpod = netpod_ref?.resolve() if(isnull(hosting_netpod) && istype(source, /obj/machinery/netpod)) diff --git a/code/modules/bitrunning/designs.dm b/code/modules/bitrunning/designs.dm new file mode 100644 index 00000000000..4e7bca1c1a8 --- /dev/null +++ b/code/modules/bitrunning/designs.dm @@ -0,0 +1,87 @@ +// Quantum server + +/obj/item/circuitboard/machine/quantum_server + name = "Quantum Server" + greyscale_colors = CIRCUIT_COLOR_SUPPLY + build_path = /obj/machinery/quantum_server + req_components = list( + /datum/stock_part/servo = 2, + /datum/stock_part/scanning_module = 1, + /datum/stock_part/capacitor = 1, + ) + +/** + * quantum server design + * are you absolutely sure?? + */ + +// Netpod + +/obj/item/circuitboard/machine/netpod + name = "Netpod" + greyscale_colors = CIRCUIT_COLOR_SUPPLY + build_path = /obj/machinery/netpod + req_components = list( + /datum/stock_part/servo = 1, + /datum/stock_part/matter_bin = 2, + ) + +/datum/design/board/netpod + name = "Netpod Board" + desc = "The circuit board for a netpod." + id = "netpod" + build_path = /obj/item/circuitboard/machine/netpod + category = list( + RND_CATEGORY_MACHINE + RND_SUBCATEGORY_MACHINE_CARGO + ) + departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING + +// Quantum console + +/obj/item/circuitboard/computer/quantum_console + name = "Quantum Console" + greyscale_colors = CIRCUIT_COLOR_SUPPLY + build_path = /obj/machinery/computer/quantum_console + +/datum/design/board/quantum_console + name = "Quantum Console Board" + desc = "Allows for the construction of circuit boards used to build a Quantum Console." + id = "quantum_console" + build_path = /obj/item/circuitboard/computer/quantum_console + category = list( + RND_CATEGORY_COMPUTER + RND_SUBCATEGORY_COMPUTER_CARGO + ) + departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING + +// Byteforge + +/obj/item/circuitboard/machine/byteforge + name = "Byteforge" + greyscale_colors = CIRCUIT_COLOR_SUPPLY + build_path = /obj/machinery/byteforge + req_components = list( + /datum/stock_part/micro_laser = 1, + ) + +/datum/design/board/byteforge + name = "Byteforge Board" + desc = "Allows for the construction of circuit boards used to build a Byteforge." + id = "byteforge" + build_path = /obj/item/circuitboard/machine/byteforge + category = list( + RND_CATEGORY_COMPUTER + RND_SUBCATEGORY_COMPUTER_CARGO + ) + departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING + + +/datum/techweb_node/bitrunning + id = "bitrunning" + display_name = "Bitrunning Technology" + description = "Bluespace technology has led to the development of quantum-scale computing, which unlocks the means to materialize atomic structures while executing advanced programs." + prereq_ids = list("practical_bluespace") + design_ids = list( + "byteforge", + "quantum_console", + "netpod", + ) + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) diff --git a/code/modules/bitrunning/objects/byteforge.dm b/code/modules/bitrunning/objects/byteforge.dm new file mode 100644 index 00000000000..e4543601ce9 --- /dev/null +++ b/code/modules/bitrunning/objects/byteforge.dm @@ -0,0 +1,55 @@ +/obj/machinery/byteforge + name = "byteforge" + + circuit = /obj/item/circuitboard/machine/byteforge + desc = "A machine used by the quantum server. Quantum code converges here, materializing decrypted assets from the virtual abyss." + icon = 'icons/obj/machines/bitrunning.dmi' + icon_state = "byteforge" + obj_flags = BLOCKS_CONSTRUCTION + /// Idle particles + var/mutable_appearance/byteforge_particles + +/obj/machinery/byteforge/Initialize(mapload) + . = ..() + + return INITIALIZE_HINT_LATELOAD + +/obj/machinery/byteforge/LateInitialize() + . = ..() + + byteforge_particles = mutable_appearance(initial(icon), "on_particles", ABOVE_MOB_LAYER) + setup_particles() + +/obj/machinery/byteforge/update_appearance(updates) + . = ..() + + setup_particles() + +/// Adds the particle overlays to the byteforge +/obj/machinery/byteforge/proc/setup_particles() + cut_overlays() + + if(is_operational) + add_overlay(byteforge_particles) + +/// Begins spawning the crate - lights, overlays, etc +/obj/machinery/byteforge/proc/start_to_spawn(obj/structure/closet/crate/secure/bitrunning/encrypted/cache) + addtimer(CALLBACK(src, PROC_REF(spawn_crate), cache), 1 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE) + + var/mutable_appearance/lighting = mutable_appearance(initial(icon), "on_overlay") + flick_overlay_view(lighting, 1 SECONDS) + + set_light(l_range = 2, l_power = 1.5, l_color = LIGHT_COLOR_BABY_BLUE, l_on = TRUE) + +/// Sparks, moves the crate to the location +/obj/machinery/byteforge/proc/spawn_crate(obj/structure/closet/crate/secure/bitrunning/encrypted/cache) + if(QDELETED(cache)) + return + + playsound(src, 'sound/magic/blink.ogg', 50, TRUE) + var/datum/effect_system/spark_spread/quantum/sparks = new() + sparks.set_up(5, 1, loc) + sparks.start() + + cache.forceMove(loc) + set_light(l_on = FALSE) diff --git a/code/modules/bitrunning/objects/host_monitor.dm b/code/modules/bitrunning/objects/host_monitor.dm index f59ca61cbd0..c35edea6319 100644 --- a/code/modules/bitrunning/objects/host_monitor.dm +++ b/code/modules/bitrunning/objects/host_monitor.dm @@ -2,10 +2,10 @@ name = "host monitor" custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 2) - desc = "A complex medical device that, when attached to an avatar's data stream, can detect the user of their host's health." + desc = "A complex electronic that will analyze the connection health between host and avatar." flags_1 = CONDUCT_1 icon = 'icons/obj/device.dmi' - icon_state = "gps-b" + icon_state = "host_monitor" inhand_icon_state = "electronic" item_flags = NOBLUDGEON lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' diff --git a/code/modules/bitrunning/objects/landmarks.dm b/code/modules/bitrunning/objects/landmarks.dm index d78283c6a8b..a4539c7c3da 100644 --- a/code/modules/bitrunning/objects/landmarks.dm +++ b/code/modules/bitrunning/objects/landmarks.dm @@ -44,11 +44,6 @@ qdel(src) -/// Where the crates get ported to station -/obj/effect/landmark/bitrunning/station_reward_spawn - name = "Bitrunning rewards spawn" - icon_state = "station" - /// Where the exit hololadder spawns /obj/effect/landmark/bitrunning/hololadder_spawn name = "Bitrunning hololadder spawn" diff --git a/code/modules/bitrunning/objects/netpod.dm b/code/modules/bitrunning/objects/netpod.dm index 349a304f04b..d92da961b86 100644 --- a/code/modules/bitrunning/objects/netpod.dm +++ b/code/modules/bitrunning/objects/netpod.dm @@ -189,7 +189,7 @@ return TRUE /obj/machinery/netpod/ui_interact(mob/user, datum/tgui/ui) - if(!is_operational) + if(!is_operational || occupant) return ui = SStgui.try_update_ui(user, src, ui) @@ -242,20 +242,12 @@ to_chat(player, span_notice("The machine disconnects itself and begins to drain.")) open_machine() -/** - * ### Disconnect occupant - * If this goes smoothly, should reconnect a receiving mind to the occupant's body - * - * This is the second stage of the process - if you want to disconn avatars start at the mind first - */ +/// Handles occupant post-disconnection effects like damage, sounds, etc /obj/machinery/netpod/proc/disconnect_occupant(forced = FALSE) - var/mob/living/mob_occupant = occupant - if(isnull(occupant) || !isliving(occupant)) - return - connected = FALSE - if(mob_occupant.stat == DEAD) + var/mob/living/mob_occupant = occupant + if(isnull(occupant) || !isliving(occupant) || mob_occupant.stat == DEAD) open_machine() return @@ -347,8 +339,9 @@ return server_ref = WEAKREF(server) - RegisterSignal(server, COMSIG_BITRUNNER_SERVER_UPGRADED, PROC_REF(on_server_upgraded), override = TRUE) - RegisterSignal(server, COMSIG_BITRUNNER_DOMAIN_COMPLETE, PROC_REF(on_domain_complete), override = TRUE) + RegisterSignal(server, COMSIG_BITRUNNER_SERVER_UPGRADED, PROC_REF(on_server_upgraded)) + RegisterSignal(server, COMSIG_BITRUNNER_DOMAIN_COMPLETE, PROC_REF(on_domain_complete)) + RegisterSignal(server, COMSIG_BITRUNNER_DOMAIN_SCRUBBED, PROC_REF(on_domain_scrubbed)) return server @@ -395,6 +388,7 @@ account.bitrunning_points += reward_points * 100 +/// User inspects the machine /obj/machinery/netpod/proc/on_examine(datum/source, mob/examiner, list/examine_text) SIGNAL_HANDLER @@ -409,7 +403,15 @@ examine_text += span_notice("It is currently occupied by [occupant].") examine_text += span_notice("It can be pried open with a crowbar, but its safety mechanisms will alert the occupant.") +/// The domain has been fully purged, so we should double check our avatar is deleted +/obj/machinery/netpod/proc/on_domain_scrubbed(datum/source) + SIGNAL_HANDLER + var/mob/living/current_avatar = avatar_ref?.resolve() + if(isnull(current_avatar)) + return + + QDEL_NULL(current_avatar) /// When the server is upgraded, drops brain damage a little /obj/machinery/netpod/proc/on_server_upgraded(datum/source, servo_rating) diff --git a/code/modules/bitrunning/objects/bit_vendor.dm b/code/modules/bitrunning/objects/vendor.dm similarity index 100% rename from code/modules/bitrunning/objects/bit_vendor.dm rename to code/modules/bitrunning/objects/vendor.dm diff --git a/code/modules/bitrunning/server/loot.dm b/code/modules/bitrunning/server/loot.dm index 29b730aae78..8b3af95607c 100644 --- a/code/modules/bitrunning/server/loot.dm +++ b/code/modules/bitrunning/server/loot.dm @@ -16,14 +16,16 @@ /// Generates a reward based on the given domain /obj/machinery/quantum_server/proc/generate_loot() - if(!length(receive_turfs) && !locate_receive_turfs()) + var/list/obj/machinery/byteforge/nearby_forges = get_nearby_forges() + if(isnull(nearby_forges)) + say(src, "No nearby byteforges detected.") return FALSE points += generated_domain.reward_points playsound(src, 'sound/machines/terminal_success.ogg', 30, 2) - var/turf/dest_turf = pick(receive_turfs) - if(isnull(dest_turf)) + var/obj/machinery/byteforge/chosen_forge = pick(nearby_forges) + if(isnull(chosen_forge)) stack_trace("Failed to find a turf to spawn loot crate on.") return FALSE @@ -34,11 +36,11 @@ certificate.name = "certificate of domain completion" certificate.update_appearance() - var/obj/structure/closet/crate/secure/bitrunning/decrypted/reward_crate = new(dest_turf, generated_domain, bonus) + var/obj/structure/closet/crate/secure/bitrunning/decrypted/reward_crate = new(src, generated_domain, bonus) reward_crate.manifest = certificate reward_crate.update_appearance() - spark_at_location(reward_crate) + chosen_forge.start_to_spawn(reward_crate) return TRUE /// Returns the markdown text containing domain completion information diff --git a/code/modules/bitrunning/server/map_handling.dm b/code/modules/bitrunning/server/map_handling.dm index 02126c290f7..741fad476f0 100644 --- a/code/modules/bitrunning/server/map_handling.dm +++ b/code/modules/bitrunning/server/map_handling.dm @@ -1,3 +1,4 @@ +#define ONLY_TURF 1 /// Gives all current occupants a notification that the server is going down /obj/machinery/quantum_server/proc/begin_shutdown(mob/user) @@ -119,7 +120,6 @@ new /obj/structure/closet/crate/secure/bitrunning/encrypted(pick(crate_turfs)) return TRUE -#define ONLY_TURF 1 // There should only ever be one turf at the bottom left of the map. /// Loads the safehouse /obj/machinery/quantum_server/proc/initialize_safehouse() @@ -160,7 +160,8 @@ /// Deletes all the tile contents /obj/machinery/quantum_server/proc/scrub_vdom() - SEND_SIGNAL(src, COMSIG_BITRUNNER_SEVER_AVATAR) // just in case + SEND_SIGNAL(src, COMSIG_BITRUNNER_SEVER_AVATAR) /// just in case someone's connected + SEND_SIGNAL(src, COMSIG_BITRUNNER_DOMAIN_SCRUBBED) // avatar cleanup just in case if(length(generated_domain.reservations)) var/datum/turf_reservation/res = generated_domain.reservations[1] diff --git a/code/modules/bitrunning/server/quantum_server.dm b/code/modules/bitrunning/server/quantum_server.dm index 404a31cca6a..b869fb7f02e 100644 --- a/code/modules/bitrunning/server/quantum_server.dm +++ b/code/modules/bitrunning/server/quantum_server.dm @@ -48,8 +48,6 @@ var/servo_bonus = 0 /// The turfs we can place a hololadder on. var/turf/exit_turfs = list() - /// The turfs on station where we generate loot. - var/turf/receive_turfs = list() /obj/machinery/quantum_server/Initialize(mapload) . = ..() @@ -84,18 +82,17 @@ avatar_connection_refs.Cut() spawned_threat_refs.Cut() QDEL_NULL(exit_turfs) - QDEL_NULL(receive_turfs) QDEL_NULL(generated_domain) QDEL_NULL(generated_safehouse) QDEL_NULL(radio) /obj/machinery/quantum_server/update_appearance(updates) if(isnull(generated_domain) || !is_operational) - set_light(0) + set_light(l_on = FALSE) return ..() set_light_color(is_ready ? LIGHT_COLOR_BABY_BLUE : LIGHT_COLOR_FIRE) - set_light(2, 1.5) + set_light(l_range = 2, l_power = 1.5, l_on = TRUE) return ..() diff --git a/code/modules/bitrunning/server/util.dm b/code/modules/bitrunning/server/util.dm index c4f1319cd12..f4dbada9ef6 100644 --- a/code/modules/bitrunning/server/util.dm +++ b/code/modules/bitrunning/server/util.dm @@ -107,14 +107,14 @@ return shuffle(mutation_candidate_refs) -/// Locates any turfs with crate out landmarks -/obj/machinery/quantum_server/proc/locate_receive_turfs() - for(var/obj/effect/landmark/bitrunning/station_reward_spawn/spawner in GLOB.landmarks_list) - if(IN_GIVEN_RANGE(src, spawner, MAX_DISTANCE)) - receive_turfs += get_turf(spawner) - qdel(spawner) +/// Locates any turfs with forges on them +/obj/machinery/quantum_server/proc/get_nearby_forges() + var/list/obj/machinery/byteforge/nearby_forges = list() - return length(receive_turfs) > 0 + for(var/obj/machinery/byteforge/forge in oview(MAX_DISTANCE, src)) + nearby_forges += forge + + return nearby_forges /// Finds any mobs with minds in the zones and gives them the bad news /obj/machinery/quantum_server/proc/notify_spawned_threats() @@ -132,10 +132,10 @@ to_chat(baddie, span_userdanger("You have been flagged for deletion! Thank you for your service.")) /// Do some magic teleport sparks -/obj/machinery/quantum_server/proc/spark_at_location(obj/crate) - playsound(crate, 'sound/magic/blink.ogg', 50, TRUE) +/obj/machinery/quantum_server/proc/spark_at_location(obj/cache) + playsound(cache, 'sound/magic/blink.ogg', 50, TRUE) var/datum/effect_system/spark_spread/quantum/sparks = new() - sparks.set_up(5, 1, get_turf(crate)) + sparks.set_up(5, 1, get_turf(cache)) sparks.start() #undef REDACTED diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index d4839542122..c6fdecbd29b 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -100,6 +100,7 @@ #include "baseturfs.dm" #include "bespoke_id.dm" #include "binary_insert.dm" +#include "bitrunning.dm" #include "blindness.dm" #include "bloody_footprints.dm" #include "breath.dm" diff --git a/code/modules/unit_tests/bitrunning.dm b/code/modules/unit_tests/bitrunning.dm new file mode 100644 index 00000000000..568eeeed8c1 --- /dev/null +++ b/code/modules/unit_tests/bitrunning.dm @@ -0,0 +1,15 @@ +/// Ensures settings on vdoms are correct +/datum/unit_test/bitrunner_vdom_settings + +/datum/unit_test/bitrunner_vdom_settings/Run() + var/obj/structure/closet/crate/secure/bitrunning/decrypted/cache = allocate(/obj/structure/closet/crate/secure/bitrunning/decrypted) + + for(var/path in subtypesof(/datum/lazy_template/virtual_domain)) + var/datum/lazy_template/virtual_domain/vdom = new path + TEST_ASSERT_NOTNULL(vdom.key, "[path] should have a key") + TEST_ASSERT_NOTNULL(vdom.map_name, "[path] should have a map name") + + if(!length(vdom.extra_loot)) + continue + + TEST_ASSERT_EQUAL(cache.spawn_loot(vdom.extra_loot), TRUE, "[path] didn't spawn loot. Extra loot should be an associative list") diff --git a/icons/obj/device.dmi b/icons/obj/device.dmi index d89ee6e5d64..fe74b6c11c5 100644 Binary files a/icons/obj/device.dmi and b/icons/obj/device.dmi differ diff --git a/icons/obj/machines/bitrunning.dmi b/icons/obj/machines/bitrunning.dmi index a910a16b35c..b3f8ad63a6c 100644 Binary files a/icons/obj/machines/bitrunning.dmi and b/icons/obj/machines/bitrunning.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 9b2f8c4c1d8..2c499469869 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3244,6 +3244,7 @@ #include "code\modules\bitrunning\abilities.dm" #include "code\modules\bitrunning\alerts.dm" #include "code\modules\bitrunning\areas.dm" +#include "code\modules\bitrunning\designs.dm" #include "code\modules\bitrunning\event.dm" #include "code\modules\bitrunning\job.dm" #include "code\modules\bitrunning\turfs.dm" @@ -3252,7 +3253,7 @@ #include "code\modules\bitrunning\components\avatar_connection.dm" #include "code\modules\bitrunning\components\bitrunning_points.dm" #include "code\modules\bitrunning\components\netpod_healing.dm" -#include "code\modules\bitrunning\objects\bit_vendor.dm" +#include "code\modules\bitrunning\objects\byteforge.dm" #include "code\modules\bitrunning\objects\clothing.dm" #include "code\modules\bitrunning\objects\disks.dm" #include "code\modules\bitrunning\objects\hololadder.dm" @@ -3261,6 +3262,7 @@ #include "code\modules\bitrunning\objects\loot_crate.dm" #include "code\modules\bitrunning\objects\netpod.dm" #include "code\modules\bitrunning\objects\quantum_console.dm" +#include "code\modules\bitrunning\objects\vendor.dm" #include "code\modules\bitrunning\orders\disks.dm" #include "code\modules\bitrunning\orders\flair.dm" #include "code\modules\bitrunning\orders\tech.dm"