TeamREPENTOGON / REPENTOGON

Script extender for The Binding of Isaac: Repentance
https://repentogon.com/
GNU General Public License v2.0
115 stars 11 forks source link

MC_PRE_GRID_X_DESTROY #418

Open Lunastela opened 3 months ago

Lunastela commented 3 months ago

The ability to test/cancel grid damage (damage to grid entities, not from them) would be incredibly useful

namishere commented 3 months ago

I've wanted to add this, but some GridEntity's Destroy functions are just Hurt(4) and that brings about logistical issues I'm not sure how to handle

Lunastela commented 3 months ago

It may be a good idea to provide callbacks for when the GridEntity is hurt as well, at least as a temporary solution, as well as being able to check how much health they have/have left (if that's not already possible, I wouldn't know, my experience with the Isaac API is very limited, but I assume it wouldn't be the case because that sounds actually convenient).

namishere commented 3 months ago

Despite explicitly being able to Hurt and Destroy them, GridEntity has no Health variable; it's left completely up to each subclass to decide how to interpret that damage. Why? Not sure! Blame Florian and/or Nicalis.

It's exactly that potential hurt callback that throws a wrench into things; neither really makes sense to have without the other. From there, how do I deal with those default functions that just call Hurt? Do I allow both callbacks to fire? Do I block the Hurt callback from firing to keep the illusion that the two functions are separate things?