Jump to content

Lurking Nightmares are spawning more than intended


Harryyw
  • Fixed
local function GetRareChildFn(inst, isemergency, target)
    local rift_active = TheWorld.components.riftspawner ~= nil and TheWorld.components.riftspawner:IsShadowPortalActive()
    local ruinsnightmare_chance = rift_active and TUNING.RUINSNIGHTMARE_SPAWN_CHANCE_RIFTS or TUNING.RUINSNIGHTMARE_SPAWN_CHANCE

    return TryLuckRoll(target, ruinsnightmare_chance, LuckFormulas.RuinsNightmare)
        and "nightmarebeak"
        or "ruinsnightmare"
end

Nightmarebeak is using the probability stated in tuning.lua right now, while that probability is designed for ruinsnightmare, so nightmare lights and nightmare fissures are spawning more ruinsnightmare before rifts, but spawning less when shadow rift is active. I'm pretty sure this is not the intended behaviour.

Compare it with the code below, which is from a version before YOTH.

local function GetRareChildFn(inst)
    local rift_active = TheWorld.components.riftspawner ~= nil and TheWorld.components.riftspawner:IsShadowPortalActive()
    local ruinsnightmare_chance = rift_active and TUNING.RUINSNIGHTMARE_SPAWN_CHANCE_RIFTS or TUNING.RUINSNIGHTMARE_SPAWN_CHANCE

    return math.random() <= ruinsnightmare_chance and "ruinsnightmare" or "nightmarebeak"
end

 


Steps to Reproduce

n/a

  • Like 1
  • Spooky 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Also notice that TryLuckRoll here is meaningless, because no target will be given when childspawner is naturally spawning children across time. Check ChildSpawner:OnUpdate()

Edited by Harryyw
  • Like 1

Share this comment


Link to comment
Share on other sites

Nice catch on the strings being swapped around.

 

Although regarding this:

14 hours ago, Harryyw said:

Also notice that TryLuckRoll here is meaningless, because no target will be given when childspawner is naturally spawning children across time. Check ChildSpawner:OnUpdate()

That's still intentional.

childspawner can be made to spawn entities with a provided target. Plus, the luck functions support passing no inst to them and will just do the dice roll as usual.

Even if nightmare lights currently don't make use of spawning an entity and targeting someone, it makes sense to have the functions like these support the luck changes, because if it were to be changed latter, or if it's modded in, it'll be accounted for.

  • Like 2

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...