… | |
… | |
1401 | |
1401 | |
1402 | int num_uncurse = max (1, spell->stats.dam + SP_level_dam_adjust (caster, spell)); |
1402 | int num_uncurse = max (1, spell->stats.dam + SP_level_dam_adjust (caster, spell)); |
1403 | |
1403 | |
1404 | op->splay_marked (); |
1404 | op->splay_marked (); |
1405 | |
1405 | |
|
|
1406 | int typeflag = spell->last_sp ? FLAG_DAMNED : FLAG_CURSED; |
|
|
1407 | |
1406 | for (object *tmp = op->inv; tmp && num_uncurse; tmp = tmp->below) |
1408 | for (object *tmp = op->inv; tmp && num_uncurse; tmp = tmp->below) |
1407 | if (!tmp->invisible |
1409 | if (!tmp->invisible && tmp->flag [typeflag]) |
1408 | && (((tmp->flag [FLAG_CURSED] && spell->flag [FLAG_CURSED]) |
|
|
1409 | || (tmp->flag [FLAG_DAMNED] && spell->flag [FLAG_DAMNED])))) |
|
|
1410 | { |
1410 | { |
1411 | ++was_one; |
1411 | ++was_one; |
1412 | |
1412 | |
1413 | if (tmp->level <= casting_level (caster, spell)) |
1413 | if (tmp->level <= casting_level (caster, spell)) |
1414 | { |
1414 | { |
1415 | ++success; |
1415 | ++success; |
1416 | --num_uncurse; |
1416 | --num_uncurse; |
1417 | |
1417 | |
1418 | if (spell->flag [FLAG_DAMNED]) |
1418 | tmp->clr_flag (typeflag); |
1419 | tmp->clr_flag (FLAG_DAMNED); |
|
|
1420 | |
|
|
1421 | tmp->clr_flag (FLAG_CURSED); |
1419 | tmp->clr_flag (FLAG_CURSED); |
1422 | tmp->clr_flag (FLAG_KNOWN_CURSED); |
1420 | tmp->clr_flag (FLAG_KNOWN_CURSED); |
1423 | tmp->value = 0; /* Still can't sell it */ |
1421 | tmp->value = 0; /* Still can't sell it */ |
1424 | |
1422 | |
1425 | if (object *pl = tmp->visible_to ()) |
1423 | if (object *pl = tmp->visible_to ()) |