Files
Bubberstation/code/modules/bitrunning/event.dm
Jeremiah 008876823c Adds two new BR maps, basic mobs, BR tweaks & fixes (#85292)
## About The Pull Request
Title. Adds two new maps: 
- Grasslands Hunt (peaceful)
- Meta Central (easy)

These maps add a new basic revolutionary mob and significantly upgrades
the ai of basic deer.
This fixes an issue where modular maps were not correctly spawning mobs
or adding them to the "mutable candidates" for antagonists.
There's also some balance changes to bitrunning vendor prices, which are
generally now lower. This change is unrelated to the PR as a whole so
I'm okay with removing it if there's concern

### photos
<details>
<summary>expand</summary>

![Screenshot 2024-07-26
151822](https://github.com/user-attachments/assets/61fd84f3-3768-4b7a-b421-a953fb8b8174)

![Screenshot 2024-07-26
151834](https://github.com/user-attachments/assets/27193237-858e-41ac-953c-6c30846c98c0)

</details>

### todo

- [x] Fix the revolutionary death anim
- [x] Make deer run when injured
## Why It's Good For The Game
New maps as a general positive for bitrunning
Bug fixes
Makes vendor choices for bitrunning-exclusive items generally less of a
chore to get
## Changelog
jlsnow301, MMMiracles, KikoWen0, Ben10Omintrix
🆑
add: Added two new bitrunning maps: Grasslands Hunt and Meta Central.
add: Deer are now more complex animals, granting them enhanced ability
to run amok and chew your favorite plants.
balance: Reduced the cost of most BR vendor items.
fix: Fixes an issue where modular virtual domains spawned less mobs than
intended.
fix: These modular spawns are now valid mutation targets to become an
antagonist.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-06 01:53:50 +02:00

99 lines
3.1 KiB
Plaintext

/datum/round_event_control/bitrunning_glitch
name = "Spawn Bitrunning Glitch"
admin_setup = list(
/datum/event_admin_setup/minimum_candidate_requirement/bitrunning_glitch,
/datum/event_admin_setup/listed_options/bitrunning_glitch,
)
category = EVENT_CATEGORY_INVASION
description = "Causes a short term antagonist to spawn in the virtual domain."
dynamic_should_hijack = FALSE
min_players = 1
max_occurrences = 0
typepath = /datum/round_event/ghost_role/bitrunning_glitch
weight = 100
/// List of servers on the station
var/list/datum/weakref/active_servers = list()
/datum/round_event_control/bitrunning_glitch/can_spawn_event(players_amt, allow_magic = FALSE)
. = ..()
if(!.)
return .
active_servers.Cut()
validate_servers()
if(length(active_servers))
return TRUE
/// All servers currently running, has players in it, and map has valid mobs
/datum/round_event_control/bitrunning_glitch/proc/validate_servers()
active_servers.Cut()
for(var/obj/machinery/quantum_server/server in SSmachines.get_machines_by_type(/obj/machinery/quantum_server))
if(server.validate_mutation_candidates())
active_servers.Add(WEAKREF(server))
return length(active_servers) > 0
/datum/event_admin_setup/listed_options/bitrunning_glitch
input_text = "Select a role to spawn."
/datum/event_admin_setup/listed_options/bitrunning_glitch/get_list()
var/list/available = list("Random")
available += subtypesof(/datum/antagonist/bitrunning_glitch)
return available
/datum/event_admin_setup/listed_options/bitrunning_glitch/apply_to_event(datum/round_event/ghost_role/bitrunning_glitch/event)
if(chosen == "Random")
event.forced_role = null
else
event.forced_role = chosen
/datum/event_admin_setup/minimum_candidate_requirement/bitrunning_glitch
output_text = "There must be valid mobs to mutate!"
/datum/event_admin_setup/minimum_candidate_requirement/bitrunning_glitch/count_candidates()
var/datum/round_event_control/bitrunning_glitch/cyber_control = event_control
cyber_control.validate_servers()
var/total = 0
for(var/datum/weakref/server_ref in cyber_control.active_servers)
var/obj/machinery/quantum_server/server = server_ref?.resolve()
if(isnull(server) || QDELETED(server))
continue
total += length(server.mutation_candidate_refs)
return total
/datum/round_event/ghost_role/bitrunning_glitch
minimum_required = 1
role_name = "Bitrunning Glitch"
fakeable = FALSE
/// Admin customization: What to spawn
var/forced_role
/datum/round_event/ghost_role/bitrunning_glitch/spawn_role()
var/datum/round_event_control/bitrunning_glitch/cyber_control = control
if(!length(cyber_control.active_servers))
return WAITING_FOR_SOMETHING
var/datum/weakref/server_ref = pick(cyber_control.active_servers)
var/obj/machinery/quantum_server/unlucky_server = server_ref?.resolve()
if(isnull(unlucky_server))
return WAITING_FOR_SOMETHING
cyber_control.active_servers.Cut()
if(!unlucky_server.validate_mutation_candidates())
return WAITING_FOR_SOMETHING
var/mob/spawned = unlucky_server.setup_glitch(forced_role)
if(isnull(spawned))
return WAITING_FOR_SOMETHING
spawned_mobs += spawned
return SUCCESSFUL_SPAWN