Zireael07 / The-Veins-of-the-Earth-original

An Underdark-themed roguelike for T-Engine

Home Page:http://www.moddb.com/mods/the-veins-of-the-earth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ice requires TWO successful Balance checks instead of 1

Zireael07 opened this issue · comments

@Sebsebeleb: As the topic says. I've no idea what causes this, as it's obviously NOT intended.

Seems to be fixed by a small function ported over from Startide.

... still here. Argh. No idea how to fix it properly.
@desophos, @Sebsebeleb , @joshkel : Any tips? I seem to recall seeing this problem fixed in one of the modules...

I think this is what's currently happening:

  • Player's turn starts. Actor:act is called.
  • Actor:act calls on_stand, which gives the player the EFF_FELL effect with duration 1.
  • On turn 2, Actor:act is called again. Actor:act calls timedEffects, which sets EFF_FELL's to 0. timedEffects only removes a temporary effect if it starts with duration 0, so the player is fallen for one more turn. Actor:act then calls on_stand again, which does a balance check, but the balance check has no effect, because the player is already fallen.
  • On turn 3, Actor:act is called again. Actor:act calls timedEffects, which expires EFF_FELL and lets the player stand up, then it calls on_stand, which may make the player fall again.

So... It should help a lot to just move the on_stand call before timedEffects.

Is the idea that a character risks falling any time they start their turn on the ice, or do they only risk falling if they move on the ice?

I think it should apply both on moving onto the ice (turn 1), as well as starting their turn on the ice (turn 2), but if they move off, it ought to be removed on turn 3.

And thanks for the tip, I'll move the on_stand call.

Looks to be fixed. Closing.