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.
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.
Comment