Jump to content

Parasite Bunnymen and Werepigs can share targets to other non-parasites on gaining a target


hoxi
  • Fixed

Specifically other Bunnymen and Werepigs, respectively, when gaining a new target.

I'd assume it's not intentional given that it doesn't match the target sharing behavior on being hit (where that wouldn't aggro other non-parasite Bunnymen/Werepigs, and instead would aggro any parasite'd entity), so I thought I'd report it to be sure. I also haven't checked if Werepigs can be affected by a parasite in the first place (I just noticed all this going through the code changes), but I'm including them in case they are.

 

For Bunnymen:

local function OnNewTarget(inst, data)
    inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, function(dude) return dude.prefab == inst.prefab end, MAX_TARGET_SHARES)
end

Should probably look like:

local function OnNewTarget(inst, data)
    if not inst:HasTag("shadowthrall_parasite_hosted") then
        inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, function(dude) return dude.prefab == inst.prefab end, MAX_TARGET_SHARES)
    end
end

Or:

local function OnNewTarget(inst, data)
    if inst:HasTag("shadowthrall_parasite_hosted") then
        inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, IsHost, MAX_TARGET_SHARES)
    else
        inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, function(dude) return dude.prefab == inst.prefab end, MAX_TARGET_SHARES)
    end
end

 

 

 

For Werepigs:

local function OnNewTarget(inst, data)
    if inst:HasTag("werepig") then
        inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, IsWerePig, MAX_TARGET_SHARES)
    end
end

Should probably look like:

local function OnNewTarget(inst, data)
    if inst:HasTag("werepig") and not inst:HasTag("shadowthrall_parasite_hosted") then
        inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, IsWerePig, MAX_TARGET_SHARES)
    end
end

Or:

local function OnNewTarget(inst, data)
    if inst:HasTag("werepig") then
        if inst:HasTag("shadowthrall_parasite_hosted") then
            inst.components.combat:ShareTarget(attacker, SHARE_TARGET_DIST, IsHost, MAX_TARGET_SHARES)
        else
            inst.components.combat:ShareTarget(data.target, SHARE_TARGET_DIST, IsWerePig, MAX_TARGET_SHARES)
        end
    end
end

 


Steps to Reproduce

Self-explanatory.

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


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