Jump to content

Inimical Gestalt transparency logic doesn't match their new aggro mechanics


hoxi
  • Pending

They no longer try to find new targets on their own, meaning that GetLevelForTarget should probably just be deprecated now, since the only thing that matters is if you're being targeted or not.

You can still potentially have sanity affect the transparency, but this might lead to confusion as sanity doesn't change a thing about their behavior, unlike with Gestalts and Greater Gestalts. If anything, maybe don't let them become too transparent.

local function GetLevelForTarget(target)
	-- L1: 0.5 to 1.0 is ignore
	-- L2: 0.0 to 0.5 is look at behaviour
	-- L3: shadow target, attack it!

	if target ~= nil then
		if target:HasTag("gestalt_possessable") then
			return 3, 0
		end

		local inventory = target.replica.inventory
		if inventory ~= nil and inventory:EquipHasTag("shadow_item") then
			return 3, 0
		end

		local sanity_rep = target.replica.sanity
		if sanity_rep ~= nil then
			local sanity = sanity_rep:IsLunacyMode() and sanity_rep:GetPercentWithPenalty() or 0
			local level = (sanity < 0.33 and 1) or 3
			return level, sanity
		end

        if target:HasAnyTag(shadow_tags) then
            return 3, 0
        end
	end

	return 1, 1
end

local function Client_CalcTransparencyRating(inst, observer)
	-- Replica component might not exist yet when we run this :)
	if inst.replica.combat and inst.replica.combat:GetTarget() ~= nil then
		return TUNING.GESTALT_COMBAT_TRANSPERENCY -- 0.85
	end

	local level, sanity = GetLevelForTarget(observer)
	if level >= 3 then
		return TUNING.GESTALT_COMBAT_TRANSPERENCY -- 0.85
    else
        local x = (.7*sanity - .7)
        return math.min(x*x + .2, TUNING.GESTALT_COMBAT_TRANSPERENCY)
    end
end

You could make it so the client transparency function always returns TUNING.GESTALT_COMBAT_TRANSPARENCY, or a lower value. This would result in:

  • Players being targeted see the 0.4 transparency automatically (from the transparenttosanity component).
  • Players not being targeted see a lower value (just not such a low one that they become too transparent, since they can just be attacked and will aggro).
    • Do keep in mind that even players who aren't being actively targeted can be hit by their charge attack (haven't verified the other new attacks), so they might just need to have very low transparency at all times to be less confusing about being a threat to players at any given time.

 

 

All that said.. It is a bit weird that they'll basically completely ignore shadow and nightmare creatures (and viceversa) now, unless provoked, as well as Night Lights, so that might need to be reconsidered maybe? They currently still have the "extinguisher" and "crazy" tags, to extinguish Night Lights and be able to attack shadow creatures, but it seems a bit pointless in their current state.

 

Slightly unrelated, is it intended that this function always returns true even if the attempts to teleport fail? Might wanna add a note if it is.

local function TryAttack_Teleport_Do(inst)
    local target = inst.components.combat.target
    -- Target is assumed to be valid here called from brain tree where it does the validation.

    local x, y, z = inst.Transform:GetWorldPosition()
    local targetpos = target:GetPosition()

    local minrange = TUNING.GESTALT_EVOLVED_CLOSE_RANGE
    local maxrange = TUNING.GESTALT_EVOLVED_MID_RANGE
    local deltarange = maxrange - minrange

    local maxtries = 10
    while maxtries > 0 do
        maxtries = maxtries - 1
        local range = math.random() * deltarange + minrange
        local offset = FindWalkableOffset(targetpos, PI2 * math.random(), range, 12, true, false, NoHoles, true, true)
        if offset then
            targetpos.x = targetpos.x + offset.x
            targetpos.z = targetpos.z + offset.z
            inst._times_hit_since_last_teleport = 0
            inst:PushEventImmediate("teleport", {dest = targetpos})
            return true
        end
    end

    return true
end

 


Steps to Reproduce

Check how Inimical Gestalt transparency changes based on sanity or wearing shadow gear, despite nothing in their current behavior relying on this logic, unlike other Gestalts.

  • Like 2



User Feedback


There are no comments to display.



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