Simulating Flooded Areas Becoming Drained

So I'd like to make a floor that is flooded and will have a lot of watery descriptions, but once the area has drained, I'd like to have the descriptions all switch to their dry versions. What would be the best way to do this? And is it possible to include a command that automatically switches all the rooms on that level to dry? Such as if someone types Drain Floor A?


Just set a flag floor.dry=True or floor.dry=False.
If True: dry description
If False: wet/flooded description


How would I get all the flags to change so that wet becomes dry on all rooms?


All you need is just one flag.


Flags and booleans work equally well.


So I'd like to make a floor that is flooded and will have a lot of watery descriptions, but once the area has drained, I'd like to have the descriptions all switch to their dry versions. What would be the best way to do this? And is it possible to include a command that automatically switches all the rooms on that level to dry? Such as if someone types Drain Floor A?

The easiest way would be to have the room descriptions be something like:

{if not floor_A_drained:You're in a flooded library, where currents in the water make the books move slightly on their shelves.}
{if floor_A_drained:You're in a library full of soggy books, smelling strongly of damp, but at least the water is gone.}

Then when the player drains the library, you can just do:

game.floor_A_drained = true

or (slightly less efficient, but the code is easier to read):

SetObjectFlagOn (game, "floor_A_drained")

or if you're using gamebook mode:

SetFlagOn ("floor_A_drained")

Log in to post a reply.

Support

Forums