Is good/great item creation wrong?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChodTheWacko
    Adept
    • Jul 2007
    • 155

    Is good/great item creation wrong?

    I'm looking at the last changeset, and I find apply_magic() to be a bit odd.

    The initial code does some random rolls based on 'lvl' to determine if an object should be good or great. (and correspondingly sets power to 1 or 2'.

    Assuming it does not generate an artifact, and creates a regular item (let's say, a sword), it does not take into account the decided 'power' when creating the sword.

    Don't you need to set good or great in order to pass this info on to make_ego_item ala:

    /* Roll for "good" */
    if (good || (rand_int(100) < f1))
    {
    /* Assume "good" */
    power = 1;
    good = TRUE;

    /* Roll for "great" */
    if (great || (rand_int(100) < f2))
    {
    power = 2;
    great = TRUE;
    }
    }


    Right now, the only thing the random rolls do is affect the odds of creating an artifact.
    Last edited by ChodTheWacko; March 30, 2008, 19:36.
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by ChodTheWacko
    I'm looking at the last changeset, and I find apply_magic() to be a bit odd.

    The initial code does some random rolls based on 'lvl' to determine if an object should be good or great. (and correspondingly sets power to 1 or 2'.

    Assuming it does not generate an artifact, and creates a regular item (let's say, a sword), it does not take into account the decided 'power' when creating the sword.

    Don't you need to set good or great in order to pass this info on to make_ego_item ...
    make_ego_item()'s third argument is actually a "force uncursed" flag: it makes sure that any egos generated don't have curses. Apparently the original author of the code wanted that to only be the case when "good" or "great" are specified, but not if it were rolled by chance. Thanks for this, I've cleaned it up now.
    takkaria whispers something about options. -more-

    Comment

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