Tackling the new curses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sirridan
    Knight
    • May 2009
    • 560

    Tackling the new curses

    I'm trying to contribute a little to the Angband source right now, and I thought it would be fun and interesting to try and implement the new curses described on some of the tickets (Anchor, pval flip, no drop, etc).

    So far, I can get them to display properly! Tomorrow I'll try and get at least Anchor implemented (no teleportation)

    Here is a dump of the broadsword (I added the curse flag to the base item just for testing)

    Code:
      [Character Equipment]
    
    a) a Broad Sword (2d5) (+0,+0) {anchor}
         Prevents teleportation.
         
         Combat info:
         2 blows/round.
         With an additional 3 strength and 3 dex you would get 3 blows
         With an additional 0 strength and 5 dex you would get 3 blows
         Average damage/hit: 9.2.
    Any thoughts/suggestions or comments?
  • PowerDiver
    Prophet
    • Mar 2008
    • 2820

    #2
    The important questions are

    (1) how does remove curse and/or *REMOVE CURSE affect the object if at all

    (2) do you plan to update the resistances screen to show curses

    (3) code for learning the flag whenever you or a monster tries to port you


    Does the current codebase use a single function whenever porting the @? If not, you should factor that out so all of the checks and learning are in one place.

    Comment

    • Sirridan
      Knight
      • May 2009
      • 560

      #3
      Originally posted by PowerDiver
      The important questions are

      (1) how does remove curse and/or *REMOVE CURSE affect the object if at all

      (2) do you plan to update the resistances screen to show curses

      (3) code for learning the flag whenever you or a monster tries to port you


      Does the current codebase use a single function whenever porting the @? If not, you should factor that out so all of the checks and learning are in one place.
      (1) I would say curse killing abilities get rid of some of them, such as NO_DROP and PVAL_FLIP, the rest could be good things for double-edged swords like escaping, mouse, etc. The already implemented curses (light/heavy/perma) are basically how difficult it would be to remove NO_DROP and PVAL_FLIP.

      (2) I had no thought of that at first, but it is a very good idea, I think I should do that.

      (3) That's coming up next, I think I remember it being a single function called by the other spells like ?phase, or tself, but I'm not 100% on that. If that is NOT how it is, I think I'll add that and add the check there.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9634

        #4
        FAangband has a curse system in place that I'm pretty happy with. In outline:
        • There are a collection of curse flags, and corresponding ID flags to show when they're known. They get learned by noticing the effects.
        • The ID spell doesn't show curses, except in the presence of a flag which indicates that all curses are known. *ID*-equivalent shows all curses.
        • Curses can potentially be removed by RC or *RC*, except in the presence of a flag which indicates that all curses are permanent
        • RC for removable curses operates per item, and has a chance of removing each curse on the item. If it fails, it can be tried again, but repeat attempts have a chance of destroying the item (even artifacts). *RC* has an improved chance.
        • Some objects and ego types get standard curses, in which case the have all curses shown by the ID spell (things of Aggravation, for example). Others get random curses, which are not shown by the ID spell.
        • Curse Weapon and Curse Armor bestow a few random (removable) curses on an item.
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • Sirridan
          Knight
          • May 2009
          • 560

          #5
          Originally posted by Nick
          FAangband has a curse system in place that I'm pretty happy with. In outline:
          • There are a collection of curse flags, and corresponding ID flags to show when they're known. They get learned by noticing the effects.
          • The ID spell doesn't show curses, except in the presence of a flag which indicates that all curses are known. *ID*-equivalent shows all curses.
          • Curses can potentially be removed by RC or *RC*, except in the presence of a flag which indicates that all curses are permanent
          • RC for removable curses operates per item, and has a chance of removing each curse on the item. If it fails, it can be tried again, but repeat attempts have a chance of destroying the item (even artifacts). *RC* has an improved chance.
          • Some objects and ego types get standard curses, in which case the have all curses shown by the ID spell (things of Aggravation, for example). Others get random curses, which are not shown by the ID spell.
          • Curse Weapon and Curse Armor bestow a few random (removable) curses on an item.
          Nifty, I'll have to check your sources and see how you implemented... if you don' mind that is

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9634

            #6
            Originally posted by Sirridan
            Nifty, I'll have to check your sources and see how you implemented... if you don' mind that is
            Go right ahead. Particularly relevant bits are the curse flags in defines.h, the notice_curse function in dungeon.c (and all calls to it, many also in dungeon.c), the checking for known curses in xtra1.c and the remove_curse* routines in spells2.c.
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

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