Bitrunning: Combat domain [READY] (#84196)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Finally dusts off this project to make a deathmatch style bitrunning
map.
Don't be too intimidated by the file diff, lots of code organization +
resized a large map.

Changes:

1. Reuses the gateway beach map as a combat zone (99% of the file diff)
(maptainers: i just added spawners and areas)
2. Alters how bitrunning handles spawning: Custom spawns are now
available, which can be anything

Misc organization:

- Splits netpod.dm into separate files.
- Fixes some wording in vdom map documentation.
- Organizes vdom variables a bit.
- Adds a permanent hololadder spawn.

How bitrunning deathmatch works: 

- Temporary spawners are offered to both ghosts and bitrunners. 
- Runners spawn in like usual. Ghost can use the spawner menu.
- Ghosts work to prevent avatars from collecting side objectives or try
to cause mass brain damage.
- The domain completes after a number of deaths accrue. Any faction.
Blood for the blood god, etc.
- This map can be played solo. ANY deaths.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
I've been toying with the idea of a deathmatch style map for some time.
I liked syndicate assault, the spawners were intentionally left there,
and the possibility of player-controlled players made the experience
more tense and challenging.

This PR leans into this idea: The virtual world is dangerous. Players
get a chance to compete on both sides here. It offers a lot of variety
to bitrunning other than "run for box". It's also very lucrative if
ghosts join in.

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: Added a bitrunning deathmatch map: Island Brawl. Both ghosts and
runners get many more spawns than normal.
fix: Lowered the static vision time in domain load in.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
This commit is contained in:
Jeremiah
2024-07-02 23:03:12 -04:00
committed by GitHub
parent 23837b3e59
commit 5dc1d36ee4
30 changed files with 13139 additions and 584 deletions
@@ -77,12 +77,18 @@
. += span_infoplain("Can be resource intensive to run. Ensure adequate power supply.")
var/upgraded = FALSE
if(capacitor_coefficient < 1)
. += span_infoplain("- Its coolant capacity reduces cooldown time by [(1 - capacitor_coefficient) * 100]%.")
upgraded = TRUE
if(servo_bonus > 0.2)
. += span_infoplain("- Its manipulation potential is increasing rewards by [servo_bonus]x.")
. += span_infoplain("- Injury from unsafe ejection reduced [servo_bonus * 100]%.")
upgraded = TRUE
if(!upgraded)
. += span_notice("Its output is suboptimal. Improved components will grant domain information, reduce cooldowns and increase rewards.")
if(!is_ready)
. += span_notice("It is currently cooling down. Give it a few moments.")
+6
View File
@@ -4,6 +4,7 @@
#define GRADE_A "A"
#define GRADE_S "S"
/// Handles calculating rewards based on number of players, parts, threats, etc
/obj/machinery/quantum_server/proc/calculate_rewards()
var/rewards_base = 0.8
@@ -20,6 +21,7 @@
return rewards_base
/// Handles spawning the (new) crate and deleting the former
/obj/machinery/quantum_server/proc/generate_loot(obj/cache, obj/machinery/byteforge/chosen_forge)
SSblackbox.record_feedback("tally", "bitrunning_domain_primary_completed", 1, generated_domain.key)
@@ -55,6 +57,8 @@
chosen_forge.start_to_spawn(reward_cache)
return TRUE
/// Builds secondary loot if the achievements were met
/obj/machinery/quantum_server/proc/generate_secondary_loot(obj/curiosity, obj/machinery/byteforge/chosen_forge)
SSblackbox.record_feedback("tally", "bitrunning_domain_secondary_completed", 1, generated_domain.key)
spark_at_location(curiosity) // abracadabra!
@@ -65,6 +69,7 @@
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(time_difference, grade)
var/base_points = generated_domain.reward_points
@@ -126,6 +131,7 @@
return generated_domain.difficulty >= BITRUNNER_DIFFICULTY_MEDIUM && (grade in passing_grades)
/// Grades the player's run based on several factors
/obj/machinery/quantum_server/proc/grade_completion(completion_time)
var/score = length(spawned_threat_refs) * 5
@@ -24,6 +24,7 @@
reset()
/// Links all the loading processes together - does validation for booting a map
/obj/machinery/quantum_server/proc/cold_boot_map(map_key)
if(!is_ready)
@@ -69,8 +70,15 @@
if(broadcasting)
start_broadcasting_network(BITRUNNER_CAMERA_NET)
if(generated_domain.announce_to_ghosts)
notify_ghosts("Bitrunners have loaded a domain that offers ghost interactions. Check the spawners menu for more information.",
src,
"Matrix Glitch",
)
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 in SSbitrunning.all_domains)
@@ -82,6 +90,7 @@
return FALSE
/// Loads in necessary map items like hololadder spawns, caches, etc
/obj/machinery/quantum_server/proc/load_map_items()
var/turf/goal_turfs = list()
@@ -116,6 +125,15 @@
var/turf/signaler_turf = get_turf(thing)
signaler_turf.AddComponent(/datum/component/bitrunning_points, generated_domain)
qdel(thing)
continue
if(istype(thing, /obj/effect/landmark/bitrunning/permanent_exit))
var/turf/tile = get_turf(thing)
exit_turfs += tile
qdel(thing)
new /obj/structure/hololadder(tile)
if(!length(exit_turfs))
CRASH("Failed to find exit turfs on generated domain.")
@@ -134,6 +152,7 @@
return TRUE
/// Stops the current virtual domain and disconnects all users
/obj/machinery/quantum_server/proc/reset(fast = FALSE)
is_ready = FALSE
@@ -155,6 +174,7 @@
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
@@ -15,6 +15,7 @@
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
@@ -35,9 +36,10 @@
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)
/obj/machinery/quantum_server/proc/generate_avatar(turf/destination, datum/outfit/netsuit)
var/mob/living/carbon/human/avatar = new(destination)
var/outfit_path = generated_domain.forced_outfit || netsuit
var/datum/outfit/to_wear = new outfit_path()
@@ -61,8 +63,9 @@
if(istype(hat))
hat.set_armor(/datum/armor/none)
for(var/obj/thing in avatar.held_items)
qdel(thing)
if(!generated_domain.forced_outfit)
for(var/obj/thing in avatar.held_items)
qdel(thing)
var/obj/item/storage/backpack/bag = avatar.back
if(istype(bag))
@@ -88,32 +91,9 @@
network = BITRUNNER_CAMERA_NET, \
emp_proof = TRUE, \
)
return avatar
/// Generates a new hololadder for the bitrunner. Effectively a respawn attempt.
/obj/machinery/quantum_server/proc/generate_hololadder()
if(!length(exit_turfs))
return
if(retries_spent >= length(exit_turfs))
return
var/turf/destination
for(var/turf/dest_turf in exit_turfs)
if(!locate(/obj/structure/hololadder) in dest_turf)
destination = dest_turf
break
if(isnull(destination))
return
var/obj/structure/hololadder/wayout = new(destination, src)
if(isnull(wayout))
return
retries_spent += 1
return wayout
/// Loads in any mob segments of the map
/obj/machinery/quantum_server/proc/load_mob_segments()
@@ -142,6 +122,7 @@
return TRUE
/// Scans over neo's contents for bitrunning tech disks. Loads the items or abilities onto the avatar.
/obj/machinery/quantum_server/proc/stock_gear(mob/living/carbon/human/avatar, mob/living/carbon/human/neo, datum/lazy_template/virtual_domain/generated_domain)
var/domain_forbids_items = generated_domain.forbids_disk_items
@@ -4,12 +4,14 @@
sever_connections()
/// Whenever a corpse spawner makes a new corpse, add it to the list of potential mutations
/obj/machinery/quantum_server/proc/on_corpse_spawned(datum/source, mob/living/corpse)
SIGNAL_HANDLER
mutation_candidate_refs.Add(WEAKREF(corpse))
/// Being qdeleted - make sure the circuit and connected mobs go with it
/obj/machinery/quantum_server/proc/on_delete(datum/source)
SIGNAL_HANDLER
@@ -26,6 +28,7 @@
if(circuit)
qdel(circuit)
/// Whenever something enters the send tiles, check if it's a loot crate. If so, alert players.
/obj/machinery/quantum_server/proc/on_goal_turf_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SIGNAL_HANDLER
@@ -51,6 +54,7 @@
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
@@ -58,6 +62,7 @@
examine_text += span_info("Beneath your gaze, the floor pulses subtly with streams of encoded data.")
examine_text += span_info("It seems to be part of the location designated for retrieving encrypted payloads.")
/// Scans over the inbound created_atoms from lazy templates
/obj/machinery/quantum_server/proc/on_template_loaded(datum/lazy_template/source, list/created_atoms)
SIGNAL_HANDLER
@@ -98,6 +103,7 @@
/// Just in case there's any special handling for the domain
generated_domain.setup_domain(created_atoms)
/// Handles when cybercops are summoned into the area or ghosts click a ghost role spawner
/obj/machinery/quantum_server/proc/on_threat_created(datum/source, mob/living/threat)
SIGNAL_HANDLER
@@ -4,6 +4,7 @@
SEND_SIGNAL(src, COMSIG_BITRUNNER_THREAT_CREATED)
threat.AddComponent(/datum/component/virtual_entity, src)
/// Choses which antagonist role is spawned based on threat
/obj/machinery/quantum_server/proc/get_antagonist_role()
var/list/available = list()
@@ -19,6 +20,7 @@
return chosen
/// Selects a target to mutate. Gives two attempts, then crashes if it fails.
/obj/machinery/quantum_server/proc/get_mutation_target()
var/datum/weakref/target_ref = pick(mutation_candidate_refs)
@@ -35,6 +37,7 @@
resolved = target_ref.resolve()
return resolved
/// Finds any mobs with minds in the zones and gives them the bad news
/obj/machinery/quantum_server/proc/notify_spawned_threats()
for(var/datum/weakref/baddie_ref as anything in spawned_threat_refs)
@@ -52,10 +55,12 @@
to_chat(baddie, span_userdanger("You have been flagged for deletion! Thank you for your service."))
/// Removes a specific threat - used when station spawning
/obj/machinery/quantum_server/proc/remove_threat(mob/living/threat)
spawned_threat_refs.Remove(WEAKREF(threat))
/// Selects the role and waits for a ghost orbiter
/obj/machinery/quantum_server/proc/setup_glitch(datum/antagonist/bitrunning_glitch/forced_role)
if(!validate_mutation_candidates())
@@ -83,6 +88,7 @@
spawn_glitch(chosen_role, mutation_target, chosen_one)
return mutation_target
/// Orbit poll has concluded - spawn the antag
/obj/machinery/quantum_server/proc/spawn_glitch(datum/antagonist/bitrunning_glitch/chosen_role, mob/living/mutation_target, mob/dead/observer/ghost)
if(QDELETED(mutation_target))
@@ -121,6 +127,7 @@
add_threats(new_mob)
/// Oh boy - transports the antag station side
/obj/machinery/quantum_server/proc/station_spawn(mob/living/antag, obj/machinery/byteforge/chosen_forge)
antag.balloon_alert(antag, "scanning...")
@@ -165,6 +172,7 @@
do_teleport(antag, get_turf(chosen_forge), forced = TRUE, asoundin = 'sound/magic/ethereal_enter.ogg', asoundout = 'sound/magic/ethereal_exit.ogg', channel = TELEPORT_CHANNEL_QUANTUM)
/// Removes any invalid candidates from the list
/obj/machinery/quantum_server/proc/validate_mutation_candidates()
for(var/datum/weakref/creature_ref as anything in mutation_candidate_refs)
+85 -8
View File
@@ -1,11 +1,13 @@
#define MAX_DISTANCE 4 // How far crates can spawn from the server
/// Resets the cooldown state and updates icons
/obj/machinery/quantum_server/proc/cool_off()
is_ready = TRUE
update_appearance()
radio.talk_into(src, "Thermal systems within operational parameters. Proceeding to domain configuration.", RADIO_CHANNEL_SUPPLY)
/// 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()
@@ -31,6 +33,49 @@
return hosted_avatars
/// I grab the atom here so I can signal it / manipulate spawners etc
/obj/machinery/quantum_server/proc/get_avatar_destination() as /atom
// Branch A: Custom spawns
if(length(generated_domain.custom_spawns))
var/atom/valid_spawner
while(isnull(valid_spawner))
var/atom/chosen = pick(generated_domain.custom_spawns)
if(QDELETED(chosen))
generated_domain.custom_spawns -= chosen
continue
valid_spawner = chosen
break
return valid_spawner
// Branch B: Hololadders
if(!length(exit_turfs))
return
if(retries_spent >= length(exit_turfs))
return
var/turf/exit_tile
for(var/turf/dest_turf in exit_turfs)
if(!locate(/obj/structure/hololadder) in dest_turf)
exit_tile = dest_turf
break
if(isnull(exit_tile))
return
var/obj/structure/hololadder/wayout = new(exit_tile, src)
if(isnull(wayout))
return
retries_spent += 1
return wayout
/// Locates any turfs with forges on them, returns a random one
/obj/machinery/quantum_server/proc/get_random_nearby_forge()
var/list/nearby_forges = list()
@@ -40,6 +85,7 @@
return pick(nearby_forges)
/// Gets a random available domain given the current points.
/obj/machinery/quantum_server/proc/get_random_domain_id()
if(points < 1)
@@ -85,6 +131,7 @@
SEND_SIGNAL(src, COMSIG_BITRUNNER_QSRV_SEVER)
/// Do some magic teleport sparks
/obj/machinery/quantum_server/proc/spark_at_location(obj/cache)
playsound(cache, 'sound/magic/blink.ogg', 50, vary = TRUE)
@@ -92,16 +139,33 @@
sparks.set_up(5, location = get_turf(cache))
sparks.start()
/// Returns a turf if it's not dense, else will find a neighbor.
/obj/machinery/quantum_server/proc/validate_turf(turf/chosen_turf)
if(!chosen_turf.is_blocked_turf())
return chosen_turf
for(var/turf/tile in get_adjacent_open_turfs(chosen_turf))
if(!tile.is_blocked_turf())
return chosen_turf
/// Starts building a new avatar for the player.
/// Called by netpods when they don't have a current avatar.
/// This is a procedural proc which links several others together.
/obj/machinery/quantum_server/proc/start_new_connection(mob/living/carbon/human/neo, datum/outfit/netsuit) as /mob/living/carbon/human
var/atom/entry_atom = get_avatar_destination()
if(isnull(entry_atom))
return
var/mob/living/carbon/new_avatar = generate_avatar(get_turf(entry_atom), netsuit)
stock_gear(new_avatar, neo, generated_domain)
// Cleanup for domains with one time use custom spawns
if(!length(generated_domain.custom_spawns))
return new_avatar
// If we're spawning from some other fuckery, no need for this
if(istype(entry_atom, /obj/effect/mob_spawn/ghost_role/human/virtual_domain))
var/obj/effect/mob_spawn/ghost_role/human/virtual_domain/spawner = entry_atom
spawner.artificial_spawn(new_avatar)
if(!generated_domain.keep_custom_spawns)
generated_domain.custom_spawns -= entry_atom
qdel(entry_atom)
return new_avatar
#undef MAX_DISTANCE
/// Toggles broadcast on and off
/obj/machinery/quantum_server/proc/toggle_broadcast()
@@ -116,3 +180,16 @@
// 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
/// Returns a turf if it's not dense, else will find a neighbor.
/obj/machinery/quantum_server/proc/validate_turf(turf/chosen_turf)
if(!chosen_turf.is_blocked_turf())
return chosen_turf
for(var/turf/tile in get_adjacent_open_turfs(chosen_turf))
if(!tile.is_blocked_turf())
return chosen_turf
#undef MAX_DISTANCE