From f56a3f67146570d646bd1bdc944c80d75d09e5cb Mon Sep 17 00:00:00 2001 From: hazelrat <83198434+hazelrat@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:55:56 +0100 Subject: [PATCH] Blobs can now spawn up to three cores per event (#21377) Blobs are too trivial, this should make them exciting. Requirements for this event to proc are two engineers, so in the worst-case you still have two people with an emitter each who can each destroy one blob and circle to the third after. Could use scrutiny from someone more familiar with event code than myself, I feel I've stepped on something here. image --- code/modules/blob/blob.dm | 17 +++++--- code/modules/events/blob.dm | 39 ++++++++--------- html/changelogs/hazelmouse-blobbuff.yml | 58 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 26 deletions(-) create mode 100644 html/changelogs/hazelmouse-blobbuff.yml diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index aad9db36630..b103d05dbf6 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -16,22 +16,27 @@ var/health var/regen_rate = 5 - // damage gets divided by these modifiers, based on damage type + /// Damage gets divided by these modifiers, based on damage type var/brute_resist = 4.3 var/fire_resist = 0.8 - var/laser_resist = 2 // Special resist for laser based weapons - Emitters or handheld energy weaponry. Damage is divided by this and THEN by fire_resist. + /// Special resist for laser based weapons - Emitters or handheld energy weaponry. Damage is divided by this and THEN by fire_resist. + var/laser_resist = 2 var/expandType = /obj/effect/blob - var/secondary_core_growth_chance = 5 //% chance to grow a secondary blob core instead of whatever was supposed to grow. Secondary cores are considerably weaker, but still nasty. + /// % chance to grow a secondary blob core instead of whatever was supposed to grow. Secondary cores are considerably weaker, but still nasty. + var/secondary_core_growth_chance = 5 var/damage_min = 15 var/damage_max = 25 var/pruned = FALSE var/product = /obj/item/blob_tendril var/attack_time = 0 - var/attack_cooldown = 60 // time in deciseconds before next attack will occur + /// Time in deciseconds before next attack will occur + var/attack_cooldown = 60 - var/obj/effect/blob/parent_core // the core this blob piece belongs to - var/is_core = FALSE // determines how to pass core inheritance + /// The core this blob piece belongs to + var/obj/effect/blob/parent_core + /// Determines how to pass core inheritance + var/is_core = FALSE /obj/effect/blob/Initialize() . = ..() diff --git a/code/modules/events/blob.dm b/code/modules/events/blob.dm index 5cb58be97d0..a1d9f28b260 100644 --- a/code/modules/events/blob.dm +++ b/code/modules/events/blob.dm @@ -1,7 +1,6 @@ /datum/event/blob - announceWhen = 12 - - var/obj/effect/blob/core/Blob + // Quite a short fuse due to the potential severity of this event. + announceWhen = 12 ic_name = "a biohazard" /datum/event/blob/announce() @@ -10,22 +9,22 @@ /datum/event/blob/start() ..() - var/turf/T = pick_subarea_turf(/area/horizon/maintenance, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) - if(!T) - log_and_message_admins("Blob failed to find a viable turf.") - kill(TRUE) - return + // This stores the list of the possible number of blobs, weighted towards 2. Adjust if a different weighting if desired. + var/list/numberOfBlobs = list(1 = 1, 2 = 2, 3 = 1) - log_and_message_admins("Blob spawned at \the [get_area(T)]", location = T) - Blob = new /obj/effect/blob/core(T) - for(var/i = 1; i < rand(3, 4); i++) - Blob.process() + // We pick randomly from the list to determine how many we spawn. + for(var/i = 1 to pickweight(numberOfBlobs)) + var/turf/T = pick_subarea_turf(/area/horizon/maintenance, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) + if(!T) + // If we can't find a turf anywhere, we aren't going to find one in subsequent loops and we can call it here. + log_and_message_admins("Blob event failed to find a viable turf.") + kill(TRUE) + return -/datum/event/blob/tick() - if(!Blob || !Blob.loc) - Blob = null - end() - kill() - return - if(IsMultiple(activeFor, 3)) - Blob.process() + log_and_message_admins("Blob spawned at \the [get_area(T)]", location = T) + // Spawn the blob in. + var/obj/effect/blob/core/Blob = new /obj/effect/blob/core(T) + + // Blobs receive a burst of growth from the moment they spawn! + for(var/int = 1 to rand(3, 4)) + Blob.process() diff --git a/html/changelogs/hazelmouse-blobbuff.yml b/html/changelogs/hazelmouse-blobbuff.yml new file mode 100644 index 00000000000..6cf735f689c --- /dev/null +++ b/html/changelogs/hazelmouse-blobbuff.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: hazelmouse + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - balance: "Blob events now have the potential to spawn as many as three cores across the map."