mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Merge remote-tracking branch 'skrat/master' into new-bubbermaster
# Conflicts: # _maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm # _maps/RandomRuins/SpaceRuins/skyrat/interdynefob.dmm # _maps/map_files/Birdshot/birdshot.dmm # _maps/map_files/Deltastation/DeltaStation2.dmm # _maps/map_files/IceBoxStation/IceBoxStation.dmm # _maps/map_files/MetaStation/MetaStation.dmm # _maps/map_files/NorthStar/north_star.dmm # _maps/map_files/VoidRaptor/VoidRaptor.dmm # _maps/map_files/tramstation/tramstation.dmm # _maps/shuttles/pirate_ex_interdyne.dmm # code/__DEFINES/mobs.dm # code/__HELPERS/~skyrat_helpers/is_helpers.dm # code/datums/mood.dm # code/game/objects/effects/spawners/random/random.dm # code/modules/admin/verbs/adminhelp.dm # code/modules/clothing/head/jobs.dm # code/modules/mob/living/brain/brain_say.dm # code/modules/projectiles/guns/energy/kinetic_accelerator.dm # code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_jelly.png # code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_jelly_stargazer.png # code/modules/uplink/uplink_items/job.dm # config/lavaruinblacklist.txt # icons/mob/actions/actions_changeling.dmi # icons/mob/clothing/mask.dmi # icons/obj/mining.dmi # modular_skyrat/master_files/code/modules/client/preferences/headshot.dm # modular_skyrat/master_files/code/modules/mob/living/examine_tgui.dm # modular_skyrat/master_files/code/modules/research/techweb/all_nodes.dm # modular_skyrat/master_files/icons/mob/clothing/under/skirts_dresses.dmi # modular_skyrat/master_files/icons/obj/clothing/under/skirts_dresses.dmi # modular_skyrat/modules/aesthetics/airlock/icons/airlocks/multi_tile/metal_overlays.dmi # modular_skyrat/modules/colony_fabricator/code/appliances/space_heater.dm # modular_skyrat/modules/company_imports/code/armament_datums/deforest_medical.dm # modular_skyrat/modules/hyposprays/code/hypospray_kits.dm # strings/traumas.json # tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/headshot.tsx
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
var/is_ready = TRUE
|
||||
/// Chance multipled by threat to spawn a glitch
|
||||
var/glitch_chance = 0.05
|
||||
/// List of available domains
|
||||
var/list/available_domains = list()
|
||||
/// Current plugged in users
|
||||
var/list/datum/weakref/avatar_connection_refs = list()
|
||||
/// Cached list of mutable mobs in zone for cybercops
|
||||
@@ -46,6 +44,10 @@
|
||||
var/threat = 0
|
||||
/// The turfs we can place a hololadder on.
|
||||
var/turf/exit_turfs = list()
|
||||
/// Determines if we broadcast to entertainment monitors or not
|
||||
var/broadcasting = FALSE
|
||||
/// Cooldown between being able to toggle broadcasting
|
||||
COOLDOWN_DECLARE(broadcast_toggle_cd)
|
||||
|
||||
/obj/machinery/quantum_server/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -63,13 +65,9 @@
|
||||
RegisterSignals(src, list(COMSIG_MACHINERY_BROKEN, COMSIG_MACHINERY_POWER_LOST), PROC_REF(on_broken))
|
||||
RegisterSignal(src, COMSIG_QDELETING, PROC_REF(on_delete))
|
||||
|
||||
// This further gets sorted in the client by cost so it's random and grouped
|
||||
available_domains = shuffle(subtypesof(/datum/lazy_template/virtual_domain))
|
||||
|
||||
/obj/machinery/quantum_server/Destroy(force)
|
||||
. = ..()
|
||||
|
||||
available_domains.Cut()
|
||||
mutation_candidate_refs.Cut()
|
||||
avatar_connection_refs.Cut()
|
||||
spawned_threat_refs.Cut()
|
||||
|
||||
@@ -40,6 +40,15 @@
|
||||
chosen_forge.start_to_spawn(reward_cache)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/quantum_server/proc/generate_secondary_loot(obj/curiosity, obj/machinery/byteforge/chosen_forge)
|
||||
spark_at_location(curiosity) // abracadabra!
|
||||
qdel(curiosity) // and it's gone!
|
||||
|
||||
var/obj/item/storage/lockbox/bitrunning/decrypted/reward_curiosity = new(src, generated_domain)
|
||||
|
||||
chosen_forge.start_to_spawn(reward_curiosity)
|
||||
return TRUE
|
||||
|
||||
/// Returns the markdown text containing domain completion information
|
||||
/obj/machinery/quantum_server/proc/get_completion_certificate()
|
||||
var/base_points = generated_domain.reward_points
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
return FALSE
|
||||
|
||||
if(isnull(map_key))
|
||||
balloon_alert_to_viewers("no domain specified.")
|
||||
balloon_alert_to_viewers("no domain specified!")
|
||||
return FALSE
|
||||
|
||||
if(generated_domain)
|
||||
balloon_alert_to_viewers("stop the current domain first.")
|
||||
balloon_alert_to_viewers("stop the current domain first!")
|
||||
return FALSE
|
||||
|
||||
if(length(avatar_connection_refs))
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/// If any one of these fail, it reverts the entire process
|
||||
if(!load_domain(map_key) || !load_map_items() || !load_mob_segments())
|
||||
balloon_alert_to_viewers("initialization failed.")
|
||||
balloon_alert_to_viewers("initialization failed!")
|
||||
scrub_vdom()
|
||||
is_ready = TRUE
|
||||
return FALSE
|
||||
@@ -63,13 +63,16 @@
|
||||
update_use_power(ACTIVE_POWER_USE)
|
||||
update_appearance()
|
||||
|
||||
if(broadcasting)
|
||||
start_broadcasting_network(BITRUNNER_CAMERA_NET)
|
||||
|
||||
return TRUE
|
||||
|
||||
/// Initializes a new domain if the given key is valid and the user has enough points
|
||||
/obj/machinery/quantum_server/proc/load_domain(map_key)
|
||||
for(var/datum/lazy_template/virtual_domain/available as anything in subtypesof(/datum/lazy_template/virtual_domain))
|
||||
if(map_key == initial(available.key) && points >= initial(available.cost))
|
||||
generated_domain = new available()
|
||||
for(var/datum/lazy_template/virtual_domain/available in SSbitrunning.all_domains)
|
||||
if(map_key == available.key && points >= available.cost)
|
||||
generated_domain = available
|
||||
RegisterSignal(generated_domain, COMSIG_LAZY_TEMPLATE_LOADED, PROC_REF(on_template_loaded))
|
||||
generated_domain.lazy_load()
|
||||
return TRUE
|
||||
@@ -80,6 +83,7 @@
|
||||
/obj/machinery/quantum_server/proc/load_map_items()
|
||||
var/turf/goal_turfs = list()
|
||||
var/turf/cache_turfs = list()
|
||||
var/turf/curiosity_turfs = list()
|
||||
|
||||
for(var/obj/effect/landmark/bitrunning/thing in GLOB.landmarks_list)
|
||||
if(istype(thing, /obj/effect/landmark/bitrunning/hololadder_spawn))
|
||||
@@ -100,6 +104,11 @@
|
||||
qdel(thing)
|
||||
continue
|
||||
|
||||
if(istype(thing, /obj/effect/landmark/bitrunning/curiosity_spawn))
|
||||
curiosity_turfs += get_turf(thing)
|
||||
qdel(thing)
|
||||
continue
|
||||
|
||||
if(istype(thing, /obj/effect/landmark/bitrunning/loot_signal))
|
||||
var/turf/signaler_turf = get_turf(thing)
|
||||
signaler_turf.AddComponent(/datum/component/bitrunning_points, generated_domain)
|
||||
@@ -113,6 +122,13 @@
|
||||
if(!attempt_spawn_cache(cache_turfs))
|
||||
return FALSE
|
||||
|
||||
while(length(curiosity_turfs))
|
||||
var/turf/picked_turf = attempt_spawn_curiosity(curiosity_turfs)
|
||||
if(!picked_turf)
|
||||
break
|
||||
generated_domain.secondary_loot_generated += 1
|
||||
curiosity_turfs -= picked_turf
|
||||
|
||||
return TRUE
|
||||
|
||||
/// Stops the current virtual domain and disconnects all users
|
||||
@@ -134,6 +150,8 @@
|
||||
domain_randomized = FALSE
|
||||
retries_spent = 0
|
||||
|
||||
stop_broadcasting_network(BITRUNNER_CAMERA_NET)
|
||||
|
||||
/// Tries to clean up everything in the domain
|
||||
/obj/machinery/quantum_server/proc/scrub_vdom()
|
||||
sever_connections() /// just in case someone's connected
|
||||
@@ -151,6 +169,8 @@
|
||||
|
||||
creature.dust(just_ash = TRUE, force = TRUE) // sometimes mobs just don't die
|
||||
|
||||
generated_domain.secondary_loot_generated = 0
|
||||
|
||||
avatar_connection_refs.Cut()
|
||||
exit_turfs = list()
|
||||
generated_domain = null
|
||||
|
||||
@@ -15,6 +15,26 @@
|
||||
new /obj/structure/closet/crate/secure/bitrunning/encrypted(chosen_turf)
|
||||
return TRUE
|
||||
|
||||
/// Attempts to spawn a lootbox
|
||||
/obj/machinery/quantum_server/proc/attempt_spawn_curiosity(list/possible_turfs)
|
||||
if(!length(possible_turfs)) // Out of turfs to place a curiosity
|
||||
return FALSE
|
||||
|
||||
if(generated_domain.secondary_loot_generated >= assoc_value_sum(generated_domain.secondary_loot)) // Out of curiosities to place
|
||||
return FALSE
|
||||
|
||||
shuffle_inplace(possible_turfs)
|
||||
var/turf/chosen_turf = validate_turf(pick(possible_turfs))
|
||||
|
||||
if(isnull(chosen_turf))
|
||||
possible_turfs.Remove(chosen_turf)
|
||||
chosen_turf = validate_turf(pick(possible_turfs))
|
||||
if(isnull(chosen_turf))
|
||||
CRASH("vdom: after two attempts, could not find a valid turf for curiosity")
|
||||
|
||||
new /obj/item/storage/lockbox/bitrunning/encrypted(chosen_turf)
|
||||
return chosen_turf
|
||||
|
||||
/// Generates a new avatar for the bitrunner.
|
||||
/obj/machinery/quantum_server/proc/generate_avatar(obj/structure/hololadder/wayout, datum/outfit/netsuit)
|
||||
var/mob/living/carbon/human/avatar = new(wayout.loc)
|
||||
@@ -23,6 +43,7 @@
|
||||
var/datum/outfit/to_wear = new outfit_path()
|
||||
|
||||
to_wear.belt = /obj/item/bitrunning_host_monitor
|
||||
to_wear.ears = null
|
||||
to_wear.glasses = null
|
||||
to_wear.gloves = null
|
||||
to_wear.l_pocket = null
|
||||
@@ -63,6 +84,13 @@
|
||||
|
||||
SSid_access.apply_trim_to_card(outfit_id, /datum/id_trim/bit_avatar)
|
||||
|
||||
avatar.AddComponent( \
|
||||
/datum/component/simple_bodycam, \
|
||||
camera_name = "bitrunner bodycam", \
|
||||
c_tag = "Avatar [avatar.real_name]", \
|
||||
network = BITRUNNER_CAMERA_NET, \
|
||||
emp_proof = TRUE, \
|
||||
)
|
||||
return avatar
|
||||
|
||||
/// Generates a new hololadder for the bitrunner. Effectively a respawn attempt.
|
||||
@@ -167,3 +195,11 @@
|
||||
|
||||
if(failed)
|
||||
to_chat(neo, span_warning("One of your disks failed to load. Check for duplicate or inactive disks."))
|
||||
|
||||
var/obj/item/organ/internal/brain/neo_brain = neo.get_organ_slot(ORGAN_SLOT_BRAIN)
|
||||
for(var/obj/item/skillchip/skill_chip as anything in neo_brain?.skillchips)
|
||||
if(!skill_chip.active)
|
||||
continue
|
||||
var/obj/item/skillchip/clone_chip = new skill_chip.type
|
||||
avatar.implant_skillchip(clone_chip, force = TRUE)
|
||||
clone_chip.try_activate_skillchip(silent = TRUE, force = TRUE)
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
generate_loot(arrived, chosen_forge)
|
||||
return
|
||||
|
||||
if(istype(arrived, /obj/item/storage/lockbox/bitrunning/encrypted))
|
||||
generate_secondary_loot(arrived, chosen_forge, generated_domain)
|
||||
return
|
||||
|
||||
/// Handles examining the server. Shows cooldown time and efficiency.
|
||||
/obj/machinery/quantum_server/proc/on_goal_turf_examined(datum/source, mob/examiner, list/examine_text)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -69,16 +69,15 @@
|
||||
|
||||
var/datum/antagonist/bitrunning_glitch/chosen_role = forced_role || get_antagonist_role()
|
||||
var/role_name = initial(chosen_role.name)
|
||||
|
||||
var/datum/callback/to_call = CALLBACK(src, PROC_REF(spawn_glitch), chosen_role, mutation_target)
|
||||
mutation_target.AddComponent(/datum/component/orbit_poll, \
|
||||
ignore_key = POLL_IGNORE_GLITCH, \
|
||||
job_bans = ROLE_GLITCH, \
|
||||
to_call = to_call, \
|
||||
title = role_name, \
|
||||
header = "Bitrunning Malfunction", \
|
||||
var/mob/chosen_one = SSpolling.poll_ghosts_for_target(
|
||||
check_jobban = ROLE_GLITCH,
|
||||
poll_time = 20 SECONDS,
|
||||
checked_target = mutation_target,
|
||||
ignore_category = POLL_IGNORE_GLITCH,
|
||||
alert_pic = mutation_target,
|
||||
role_name_text = "Bitrunning Malfunction: [role_name]",
|
||||
)
|
||||
|
||||
spawn_glitch(chosen_role, mutation_target, chosen_one)
|
||||
return mutation_target
|
||||
|
||||
/// Orbit poll has concluded - spawn the antag
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define REDACTED "???"
|
||||
#define MAX_DISTANCE 4 // How far crates can spawn from the server
|
||||
|
||||
/// Resets the cooldown state and updates icons
|
||||
@@ -15,28 +14,6 @@
|
||||
//BUBBER ADDITION END
|
||||
radio.talk_into(src, "Thermal systems within operational parameters. Proceeding to domain configuration.", RADIO_CHANNEL_SUPPLY)
|
||||
|
||||
/// Compiles a list of available domains.
|
||||
/obj/machinery/quantum_server/proc/get_available_domains()
|
||||
var/list/levels = list()
|
||||
|
||||
for(var/datum/lazy_template/virtual_domain/domain as anything in available_domains)
|
||||
if(initial(domain.test_only))
|
||||
continue
|
||||
var/can_view = initial(domain.difficulty) < scanner_tier && initial(domain.cost) <= points + 5
|
||||
var/can_view_reward = initial(domain.difficulty) < (scanner_tier + 1) && initial(domain.cost) <= points + 3
|
||||
|
||||
levels += list(list(
|
||||
"cost" = initial(domain.cost),
|
||||
"desc" = can_view ? initial(domain.desc) : "Limited scanning capabilities. Cannot infer domain details.",
|
||||
"difficulty" = initial(domain.difficulty),
|
||||
"id" = initial(domain.key),
|
||||
"is_modular" = initial(domain.is_modular),
|
||||
"name" = can_view ? initial(domain.name) : REDACTED,
|
||||
"reward" = can_view_reward ? initial(domain.reward_points) : REDACTED,
|
||||
))
|
||||
|
||||
return levels
|
||||
|
||||
/// If there are hosted minds, attempts to get a list of their current virtual bodies w/ vitals
|
||||
/obj/machinery/quantum_server/proc/get_avatar_data()
|
||||
var/list/hosted_avatars = list()
|
||||
@@ -128,5 +105,18 @@
|
||||
if(!tile.is_blocked_turf())
|
||||
return chosen_turf
|
||||
|
||||
#undef REDACTED
|
||||
#undef MAX_DISTANCE
|
||||
|
||||
/// Toggles broadcast on and off
|
||||
/obj/machinery/quantum_server/proc/toggle_broadcast()
|
||||
if(!COOLDOWN_FINISHED(src, broadcast_toggle_cd))
|
||||
return FALSE
|
||||
|
||||
broadcasting = !broadcasting
|
||||
|
||||
if(generated_domain)
|
||||
// The cooldown only really matter is we're flipping TVs
|
||||
COOLDOWN_START(src, broadcast_toggle_cd, 5 SECONDS)
|
||||
// And we only flip TVs when there's a domain, because otherwise there's no cams to watch
|
||||
set_network_broadcast_status(BITRUNNER_CAMERA_NET, broadcasting)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user