mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
[MIRROR] Bitrunning 1.5: Secondary Objectives (#26821)
* Bitrunning 1.5: Secondary Objectives (#81828) ## About The Pull Request Added secondary objective lockboxes to bitrunning. These pull from a list of secondary objective loot on the domain, with a limited quantity of items. Once there are no items left to pull, the secondary objective disappears. If multiple secondary objective markers are placed, they will be placed until all markers have been used, or all the items in the loot pool are already spoken for. To support this functionality, adds SSbitrunning, which stores all domains as instances, instead of checking the hardcoded types as previously. SSbitrunning manages listing domains for the quantum console, and rolling secondary loot. As an example of this functionality, added a side path to Glacier Grind with a polar bear and some loot. ## Why It's Good For The Game Secondary objectives give mappers ways to encourage players to venture into a wider range of domains by offering non-trivial loot beyond the fluff items given in the main caches. The absolute limit on the number of items available ensures these items can't be farmed. As well as supporting secondary objectives, SSbitrunning allows for future support of features relying on mid-round modification of domains, for instance adding custom domains. ## Changelog 🆑 add: Added secondary objectives to bitrunning! add: Pick up encrypted curiosities and return them to the safehouse to claim their contents. add: Glacier Grind has been given a secondary objective, look out for the limited edition hat. add: Bitrunning domains can now be modified during the round by admins. /🆑 * Bitrunning 1.5: Secondary Objectives * Update virtual_domain.dm --------- Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com> Co-authored-by: Pinta <68373373+softcerv@users.noreply.github.com>
This commit is contained in:
co-authored by
Thunder12345
Pinta
parent
0c051e6102
commit
0a693b9dfa
@@ -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
|
||||
@@ -63,13 +61,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
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
|
||||
/// 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 +80,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 +101,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 +119,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
|
||||
@@ -151,6 +164,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -7,28 +6,6 @@
|
||||
update_appearance()
|
||||
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()
|
||||
@@ -120,5 +97,4 @@
|
||||
if(!tile.is_blocked_turf())
|
||||
return chosen_turf
|
||||
|
||||
#undef REDACTED
|
||||
#undef MAX_DISTANCE
|
||||
|
||||
Reference in New Issue
Block a user