ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

Please simplify the code for barriers in both directions #506

Closed hnejfnvjojgrogjwm closed 1 year ago

hnejfnvjojgrogjwm commented 1 year ago

Right now if I want to block a way in both directions, I have to type two barriers like this:

   locked_1 : block_path {
      from              = loc_corridor_east
      to                = loc_corridor_west
      message           = The door is locked.
      block_when        = locked_door
      show_blocked_exit = true
   }
   locked_2 : block_path {
      from              = loc_corridor_west
      to                = loc_corridor_east
      message           = The door is locked.
      block_when        = locked_door
      show_blocked_exit = true
   }

I think it will be easier if we can type something like this:

   locked : block_path {
      from              = loc_corridor_east
      to                = loc_corridor_west
      message           = The door is locked.
      block_when        = locked_door
      both_directions   = yes
      show_blocked_exit = true
   }

This type of code (block one path, but in both directions) is necessary when the player can be in both sides of the door (through another path) but the door must block both directions.

ainslec commented 1 year ago

In beta 76.

ainslec commented 1 year ago
   barrier_cupboard_door : block_path {
      from          = hallway
      to            = cupboard
      message       = The door to the cupboard is closed.
      bidirectional = true
      block_when_not = is_door_open
   }