Jump to content

Brightshade waves aren't always removed when a corpse is mutated


hoxi
  • Pending

It specifically only triggers through the stategraph from the Incursive Gestalt, meaning that when entities are asleep (offscreen), this won't be able to trigger.

FrameEvent(19, function(inst)
	inst.persists = false

	-- lunarthrall_plant_gestalt handler.
	if inst.plant_target and inst.plant_target:IsValid() then
		TheWorld.components.lunarthrall_plantspawner:SpawnPlant(inst.plant_target)

	-- corpse_gestalt handler.
	elseif inst.sg.statemem.corpse ~= nil and inst.sg.statemem.corpse:IsValid() then
		inst.sg.statemem.corpse:StartLunarRiftMutation()

		if TheWorld.components.lunarthrall_plantspawner ~= nil and not inst.sg.statemem.corpse:HasTag("small_corpse") then
			TheWorld.components.lunarthrall_plantspawner:RemoveWave()
		end
	end
end),

This should probably not be there and instead be in the StartLunarRiftMutation function itself from corpses.lua, but I have a suggestion further below.

 

There's also another stategraph state in there that, normally shouldn't be used to infest corpses, but still has logic for it, except for the wave removal. But like with the previous case, I have a better suggestion than just adding the checks there.

 

The corpses.lua file also a few cases of just replacing the corpse prefab with the mutated prefab when asleep (offscreen), through tasks from OnEntitySleep. This also needs to be accounted for.

 

To consolidate all of these into a more consistent approach, you could make it so the lunarthrall_plantspawner component listens for an event. The event listener function can then check the corpse entity sent to it like in the block of code above (including if it's small or not, or any other potential new checks in the future, let any sort of verification be handled here, as it's relevant to this component).

You can then fire this listener from any case of a lunar rift mutation starting (except from loading), whether it's happening normally or if it's an instant prefab replacement offscreen.

 

 

Slightly related, I always found it weird how the Incursive Gestalts that infest corpses don't come out of the lunar rift if a player is close to them (along with the corpse). I know it'd take some extra work, but it'd be really cool, especially if seeing the Gestalt return to the rift if it failed to mutate the corpse.

 

 

EDIT: in one of the comments below, I pointed out something I realized when explaining something there.

Mutations starting before the rift has reached its final stage will result in no effect to the upcoming waves, this should probably be accounted for by keeping track of it with a separate variable (if the value exceeds the determined amount of waves, you could immediately run the code to start the rift closing process). Just make sure that the value persists between saving and loading.

Also, the following values in lunarthrall_plantspawner could be made to be TUNING values, they're currently hard-coded into the functions:

-- the base value and variance value could be TUNING values
-- (you don't need two values for the latter, it can just be a math.random(variance) call, 1 is implicit then)
self.waves_to_release = 3 + math.random(1,3)

-- 3 not being a TUNING value means the whole function would need to be overridden to change that
while #plants > 0 and number_spawned < 3 do

 


Steps to Reproduce
  • Kill Bearger or Deerclops or a Varg with the lunar rifts open.
  • Go away or teleport, far away enough for entity sleep distance, before the mutation starts.
  • Return and find the mutated creature boss.
  • Verify that the amount of Brightshade waves haven't decreased by 1 as intended.
  • Like 1



User Feedback


Hi, I want ask a little bit further about the brightshade wave removal because I heard about it but lack the knowledge to figure out how it works.

Typically what is the max amount of brightshade waves per rift, and what exactly will happen when more than enough mutated bosses are killed so that this number of waves reaches zero? Will the rift close instantly regardless of its stage, or close when it reaches max stage, or something else different?

I am playing in a server where deerclops are farmed a lot with hostile flares, and crystal deers too since gotta kill it before firing another flare. I mean, do we just unwittingly doom ourselves with brightshade husk shortage just for doing this?

 

Share this comment


Link to comment
Share on other sites

8 hours ago, namhai said:

Typically what is the max amount of brightshade waves per rift

The amount of waves has a static value of 3, plus a random variance between 1 and 3 is added to that, for a minimum of 4 and a maximum of 6.

 

8 hours ago, namhai said:

and what exactly will happen when more than enough mutated bosses are killed so that this number of waves reaches zero? Will the rift close instantly regardless of its stage, or close when it reaches max stage, or something else different?

It's not killing a boss that can mutate (or killing a mutated boss), that subtracts from the number of waves, but rather the corpse mutation starting is what does it (except, as reported here, when offscreen, which needs to be addressed).

If the rift hasn't reached its final stage (and thus hasn't set up the amount of waves), there will be no effect. This.. should probably be accounted for.. it wouldn't be too complicated. Could just keep track of it with a separate value in the component, and have this value be saved to persist when saving and loading the game.

Anyhow, when the rift is on its final stage and waves have been set, having a boss start mutating subtracts 1 wave. If reaching 0, the same thing that happens when the last wave starts to spawn will happen. A 10-second timer is started, which then starts the process to remove the rift, it doesn't instantly close in either case.

 

8 hours ago, namhai said:

I am playing in a server where deerclops are farmed a lot with hostile flares, and crystal deers too since gotta kill it before firing another flare. I mean, do we just unwittingly doom ourselves with brightshade husk shortage just for doing this?

As explained above, if you do this before the rift reaches its final stage, you won't be removing any waves from it. This is the case for now at least.

If you do this after the rift has reached its final stage, then yeah, you'll be removing waves of Brightshades from spawning entirely.

Edited by hoxi
  • Thanks 1
  • Big Ups 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...