Refer a Friend
  1. #1

    EffectManager.hasTag bug (I think)...

    I have a target with the effect:

    "IMMUNE: fire"

    My Improved Critical extension checks for crit immunity by using:

    "local bCritImmune = EffectManager.hasTag(rActor, "IMMUNE", { tFilter = { "critical" }, })"

    ... which results in "true".

    If I change the effect to:

    "IMMUNE: dkjflskfjs"

    ... the check results in a "false"

    It's like tFilter is being ignored for recognized damage types?

    I haven't dug into it tho...is there some other way to check an actor for specific immunity?

    Thanks!

  2. #2
    Damage types don't filter by design; as that would some use cases.

    To check whether a creature is immune to the critical damage type, try:
    Code:
    	local bImmuneCritical = false;
    	for _,tEffect in ipairs(EffectManager.getCompsDataByTag(rActor, "IMMUNE", { rTarget = rSource, })) do
    		for _,s in ipairs(tEffect.remainder) do
    			if s == "critical" then
    				bImmuneCritical = true;
    				break;
    			end
    		end
    	end
    Regards,
    JPG

  3. #3
    Thanks! I did a similar thing with matching for "IMMUNE" and "critical" in tEffect, but yours is more robust.

  4. #4
    Another slightly simpler version:

    Code:
    	local bImmuneCritical = false;
    	for _,tCompData in ipairs(EffectManager.getCompsDataByTag(rActor, "IMMUNE", { rTarget = rSource, })) do
    		if StringManager.contains(tCompData.remainder, "critical") then
    			bImmuneCritical = true;
    			break;
    		end
    	end
    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in