feat: add new vent hordes & sounds, vent breaking#899
Conversation
|
RSI Diff Bot; head commit fef1e2f merging into 7207823 Resources/Textures/_starcup/Structures/Piping/vent_destroyed.rsi
|
for more information, see https://pre-commit.ci
…ymbiote/starcup into feat-add-vent-hordes-&-sounds
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
| } | ||
|
|
||
| // begin starcup: Remove the horde spawner entity and spawn a replacement (perhaps a broken version of it). | ||
| if (_random.Prob(entity.Comp.VentBreakChance)) |
There was a problem hiding this comment.
I think we should move this random check to StartHordeSpawn and use it to set a data field on VentHordeSpawnerComponent. The advantage of that is to better handle a situation when events overlap on the same vent, similar to what's being done on lines 72 through 80.
If mice and goliaths are coming out at the same time, the vent should break on account of the goliaths, rather than not break on account of the mice coming slightly afterward.
Here's how we can accomplish that. Assignment works like this: variableToAssign = valueToBeAssigned, with the right-hand side being what we want to assign to a variable or field. Compound assignment is shorthand for variableToAssign = variableToAssign + someValue, or variableToAssign += someValue. The result of the boolean OR operation is true if and only if one of the values is true.
bool someVariable = false;
someVariable |= true;
// someVariable: true
// boolean OR won't overwrite true with false
someVariable |= false;
// someVariable: trueSuppose we add a new data field in VentHordeSpawnerComponent, bool ShouldBreakVent.
// in StartHordeSpawn, somewhere
hordeSpawner.ShouldBreakVent |= _random.Prob(breakChance);
// We remove this line (and its corresponding DataField) because they've been replaced by the above addition.
// hordeSpawner.VentBreakChance = ventBreakChance;Then, later in EndHordeSpawn ...
// Replace the old logic with checking the new data field
// if (_random.Prob(entity.Comp.VentBreakChance))
if (entity.Comp.ShouldBreakVent)




Turns our old localized vent critter events into vent hordes, and adds new vent horde and station-wide migration events, as well as custom sounds for several of them. Also makes it so certain vent horde events can result in the vent itself being destroyed and be replaced by a broken vent or one of three types of special broken vents that also work as timed spawners.
Not all vent horde events will break vents. Some of them will leave them intact, and some won't, and spawn a harmless, nonfunctional broken vent instead. Mice and bat vent hordes have a 50% chance of breaking it and spawning a vent den, which will check to spawn a mouse or bat every minute. Xeno and aberrant flesh hordes will always break the vent and replace it with an appropriate spawner.
TO DO: Troubleshoot why the VentHordeSpawnerComponent is using only the first of the three sounds in the VentCrawlGeneric sound collection.
Why / Balance
Custom vent horde sounds can serve as a warning for players with good memory for audio cues as well as a roleplay prompt. The new broken and spawner vents not only add to the immersion of the event, but also gives atmospherics, engineering or just tool-savvy players a little bit of extra gameplay as they go to de- and reconstruct them.
Technical details
Media
vents.mp4
Changelog
Not really player facing?