… | |
… | |
510 | int olevel = op->inv->level + int (difficulty * (1. - rndm () * rndm () * 2.)); |
510 | int olevel = op->inv->level + int (difficulty * (1. - rndm () * rndm () * 2.)); |
511 | |
511 | |
512 | if (olevel <= 0) |
512 | if (olevel <= 0) |
513 | olevel = rndm (1, op->inv->level); |
513 | olevel = rndm (1, op->inv->level); |
514 | |
514 | |
515 | return min (olevel, MAXLEVEL); |
515 | return min (olevel, MAXLEVEL_TREASURE); |
516 | } |
516 | } |
517 | |
517 | |
518 | /* |
518 | /* |
519 | * Based upon the specified difficulty and upon the difftomagic_list array, |
519 | * Based upon the specified difficulty and upon the difftomagic_list array, |
520 | * a random magical bonus is returned. This is used when determine |
520 | * a random magical bonus is returned. This is used when determine |