mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 04:16:56 +01:00
…l-Station-13-RP into opendream_branch<!-- 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 adjusts the repo to work with opendream <!-- 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 a more modern, and hopefully more reliable engine!!! <!-- 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. --> 🆑 code: changed the code to work with Opendream /🆑 <!-- 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. -->
72 lines
2.4 KiB
Plaintext
72 lines
2.4 KiB
Plaintext
/datum/gm_action/blob
|
|
name = "blob infestation"
|
|
departments = list(DEPARTMENT_ENGINEERING, DEPARTMENT_SECURITY, DEPARTMENT_MEDICAL)
|
|
chaotic = 25
|
|
|
|
var/list/area/excluded = list(
|
|
/area/submap,
|
|
/area/shuttle,
|
|
/area/crew_quarters,
|
|
/area/holodeck,
|
|
/area/engineering/engine_room
|
|
)
|
|
|
|
var/area/target_area // Chosen target area
|
|
var/turf/target_turf // Chosen target turf in target_area
|
|
|
|
var/obj/structure/blob/core/Blob
|
|
var/spawn_blob_type = /obj/structure/blob/core/random_medium
|
|
|
|
/datum/gm_action/blob/set_up()
|
|
severity = pick_weight(mundande_weight = 4, moderate_weight = 2, major_weight = 1)
|
|
|
|
var/list/area/grand_list_of_areas = get_station_areas(excluded)
|
|
|
|
for(var/i in 1 to 10)
|
|
var/area/A = pick(grand_list_of_areas)
|
|
if(is_area_occupied(A))
|
|
log_debug(SPAN_DEBUGWARNING("Blob infestation event: Rejected [A] because it is occupied."))
|
|
continue
|
|
var/list/turfs = list()
|
|
for(var/turf/simulated/floor/F in A)
|
|
if(turf_clear(F))
|
|
turfs += F
|
|
if(turfs.len == 0)
|
|
log_debug(SPAN_DEBUGWARNING("Blob infestation event: Rejected [A] because it has no clear turfs."))
|
|
continue
|
|
target_area = A
|
|
target_turf = pick(turfs)
|
|
|
|
if(!target_area)
|
|
log_debug(SPAN_DEBUGWARNING("Blob infestation event: Giving up after too many failures to pick target area"))
|
|
|
|
/datum/gm_action/blob/start()
|
|
..()
|
|
var/turf/T
|
|
|
|
if(severity == EVENT_LEVEL_MUNDANE || !target_area || !target_turf)
|
|
T = pick(blobstart)
|
|
else if(severity == EVENT_LEVEL_MODERATE)
|
|
T = target_turf
|
|
else
|
|
T = target_turf
|
|
spawn_blob_type = /obj/structure/blob/core/random_hard
|
|
|
|
Blob = new spawn_blob_type(T)
|
|
|
|
/datum/gm_action/blob/announce()
|
|
spawn(rand(600, 3000)) // 1-5 minute leeway for the blob to go un-detected.
|
|
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
|
|
|
|
/datum/gm_action/blob/get_weight()
|
|
var/engineers = metric.count_people_in_department(DEPARTMENT_ENGINEERING)
|
|
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
|
var/medical = metric.count_people_in_department(DEPARTMENT_MEDICAL)
|
|
|
|
var/assigned_staff = engineers + security
|
|
if(engineers || security) // Medical only counts if one of the other two exists, and even then they count as half.
|
|
assigned_staff += round(medical / 2)
|
|
|
|
var/weight = (max(assigned_staff - 2, 0) * 20) // An assigned staff count of 2 must be had to spawn a blob.
|
|
return weight
|