Unseen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xgp
    Rookie
    • Apr 2020
    • 23

    Unseen

    I have a question regarding checking whether the player is seen. This is an excerpt of the source code:

    Code:
    (Sil)
           // check if player is unseen
            if ((r_ptr->light > 0) && strchr("@G", r_ptr->d_char) && (cave_light[p_ptr->py][p_ptr->px] <= 0)) unseen = TRUE;
    
    (Sil-Q)
            // check if player is unseen
            if ((r_ptr->light > 0) && strchr("@G", r_ptr->d_char)
                && (cave_light[p_ptr->py][p_ptr->px] <= 0))
                unseen = TRUE;
    ​
    It seems to mean that a light-bearing @ or G cannot see the player staying in the darkness, which is somewhat unusual as the reverse appears to make more sense. Do I miss something?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9632

    #2
    I think that's right - the monster carrying the light has their eyes adjusted to the light, and so can't see the player in the dark.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • xgp
      Rookie
      • Apr 2020
      • 23

      #3
      Thank you, Nick. A follow-up question: is it a more precise design if this is changed to do a combination of the player's and the monster's light levels, and let the monster not see the player if the resulted light level <= 0? I think this approach aligns with the mechanism of monster's visibility to the player.

      Comment

      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎