Tuesday, May 6, 2014

Dev Log: Horror Text Adventure #48

I added "climb" as a move word, currently synonymous with "walk" and such.  So the player can say "climb north" for now, which doesn't make much sense, but I'll fix to have the correct usage later.  A player might say "climb over the counter" or "climb the stairs" or "climb through the window", so what I'll do soon is make it so if the player uses "climb" (or for that matter, any move command) with a barrier type, if there is only one of that type of barrier in the room, the player will just go through it, regardless of direction.

I chopped out barrier types as individual classes, just like I had done with rooms.  Now every barrier has the same booleans; many just won't change.  This was so that way I could have an easier time coding up locking things, so the player can lock doors and windows (and potentially items).

So, I got locking barriers to work next (at least barrier types that are lockable without a key).  So windows and doors default to lockable without a key, so the player can type "lock door" and it will lock the door in the room.  I'm working on functionality to check for more than one door and for the player to specify which door.  I'm also partway there with lockable items, like chests and stuff.

Next, of course, I had to add a check for locked barriers when the player tries to move, so if the door is locked they can't get through it.  The error message is still simply "you can't go that way", so I'll have to find a way to split up messages to say expressly why a player can't go a certain way.

Next comes unlocking.  And probably preventing locking in common areas, because that would get annoying.

No comments:

Post a Comment