blocked on some minor development.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    blocked on some minor development.

    I was trying to get my hand back in to coding for angband.

    I am trying to implement this:


    but i am blocked by this:
    The contents of this structure are an array of resistance levels and a bitarray of flags. So you only need one element_info per object. But in the code, it is written as an array of size ELEM_MAX (...

    Note: see my final comment on what confuses me: why does each element_info record have an associated bitflag???

    Nick, can you explain how element_info is actually used, so i can finish this? It is a pretty easy problem otherwise.
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    The bitflag field is for recording how the item itself reacts to the element - so it can contain the EL_INFO_HATES flag if the element can destroy it, or the EL_INFO_IGNORE flag if the element can't destroy it. The HATES flag is assigned to object bases (tvals), and then the IGNORE flag can be applied to exceptions.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Pete Mack
      Prophet
      • Apr 2007
      • 6883

      #3
      thanks much. Adding a comment to this effect. Also: if the object gets a random resist, shouldn't it also get set to
      obj-init.c:356,362
      Code:
          obj_info[effect].flags |= EL_INFO_RESIST | EL_INFO_RANDOM;
      not just:
      Code:
          obj_info[effect].flags |=  EL_INFO_RANDOM;
      That is, it should resist the element if it has a resistance from any source.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9637

        #4
        Originally posted by Pete Mack
        thanks much. Adding a comment to this effect. Also: if the object gets a random resist, shouldn't it also get set to
        obj-init.c:356,362
        Code:
            obj_info[effect].flags |= EL_INFO_RESIST | EL_INFO_RANDOM;
        not just:
        Code:
            obj_info[effect].flags |=  EL_INFO_RANDOM;
        That is, it should resist the element if it has a resistance from any source.
        No, the actual resist is handled by the res_level field (1 being single resist, 3 immunity). Some of the reason for the way this stuff is structured is to allow for use in variants with more resistance levels than V.
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #5
          Sure, but as written, the object can get destroyed by an element if it has a random resist, but not if it has a default resist. Or that is what it looks like.

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9637

            #6
            Originally posted by Pete Mack
            Sure, but as written, the object can get destroyed by an element if it has a random resist, but not if it has a default resist. Or that is what it looks like.
            Oh, I get it. Yes it should. Bug filed.
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

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