Jump to content

Recommended Posts

Hi, i'm developing a mod which gives the ability to shadow creatures to apply a "curse" effect.

I made the lines of code which call for which creature has to apply the curse and for how much time.

The curse works perfectly on every shadow creature, except for two:

shadow rook and shadow bishop

Here is the code

local function OnAttackOther(inst, data)
    if data.target ~= nil and data.target.components.curse ~= nil then
        data.target.components.curse:ApplyCurse(4)
    end
end

AddPrefabPostInit("shadow_rook", function(inst)
    if not GLOBAL.TheWorld.ismastersim then
        return
    end
    inst:ListenForEvent("onattackother", OnAttackOther)
end)
 

So, i think it has to do with the fact that shadow rook and shadow bishop create another "entity" or whatever you call it when they attack, but as of now i haven't been able to understand what's the core problem.

Thanks in advance!

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