Jump to content

Ultimate sanity station with maximum efficiency


Recommended Posts

In DST, you can use Bee Queen Crown to negate sanity aura, and evil flowers are easy to mass produce and place close enough to stack the aura. As discussed previously, this is very efficient. However, those calculations are beyond what the game actually cares about. According to `components/sanity.lua`, character's aura gain/loss is calculated based on a variable `TUNING.SANITY_EFFECT_RANGE` (it is set to 10 in `tuning.lua`); only entities within this range will contribute to aura calculation. Therefore, making a sanity station beyond this radius merely serves aesthetic purposes, or to provide larger center point for maximum sanity gain for multiple players to snuggle up in the center.

 local aura_delta = 0
    local x, y, z = self.inst.Transform:GetWorldPosition()
    local ents = TheSim:FindEntities(x, y, z, TUNING.SANITY_EFFECT_RANGE, nil, { "FX", "NOCLICK", "DECOR","INLIMBO" })
    for i, v in ipairs(ents) do 
        if v.components.sanityaura ~= nil and v ~= self.inst then
            local aura_val = v.components.sanityaura:GetAura(self.inst) / math.max(1, self.inst:GetDistanceSqToInst(v))
            aura_delta = aura_delta + (aura_val < 0 and (self.neg_aura_absorb > 0 and self.neg_aura_absorb * -aura_val or aura_val) * self.neg_aura_mult or aura_val)
        end
    end

 

Already accounted for that in the post.

Quote

Note the maximum radius is 10 units away for sanity to take effect on the player, and that the flower placements are 0.75 units away from each other in a grid with the player standing right in the center.

TSD2nOi.png

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...