epfly6 / RepentanceAPIIssueTracker

An unofficial issue tracker for issues with The Binding of Isaac: Repentance's API.
20 stars 1 forks source link

A method to identify tears spawned by the effect of Vasculitis #277

Open TaigaTreant opened 3 years ago

TaigaTreant commented 3 years ago

Vasculitis has an effect where the tears spawned by it when enemies die carry the effect of status effects the enemy had. However, there is currently no way to identify tears spawned by this effect; there is no TearFlag associated with the effect, no SpawnerEntity is set on TEAR_INIT, nor is there any other method such as a callback or otherwise. As such, if you implement your own status effects you cannot currently make it work with Vasculitis. As such, it would be desirable to have some sort of method to identify tears spawned by this effect, as well as maybe having access to the entity that spawned the tears (such as via a callback when spawning the tears).

Zamiell commented 3 years ago

I use this:

function isVasculitisTear(tear: EntityTear) {
  // tear.SpawnerType will be equal to 1 if it was shot by the player
  return (
    tear.FrameCount === 0 &&
    tear.SpawnerType === 0 &&
    anyPlayerHasCollectible(CollectibleType.COLLECTIBLE_VASCULITIS)
  );
}
TaigaTreant commented 3 years ago

Isn't this subject to false positives due to other effects in the game?

Zamiell commented 3 years ago

Which other ones?

TaigaTreant commented 3 years ago

I could have sworn that there were others, but I cannot seem to find any on examination. Maybe something changed between Afterbirth+ and Repentance. Regardless, I still think there should be a method to ensure tears were spawned by Vasculitis to avoid any such potential false positives, especially when you start considering the presence of other mods that may or may not set SpawnerEntity on spawned tears. There's also still the issue of needing to identify which enemy the tears spawned from so as to be able to tell if they had any custom status effects to pass on.