can object be generated eroded? */
| 174 | |
| 175 | /* can object be generated eroded? */ |
| 176 | staticfn boolean |
| 177 | may_generate_eroded(struct obj *otmp) |
| 178 | { |
| 179 | /* initial hero inventory */ |
| 180 | if (svm.moves <= 1 && !gi.in_mklev) |
| 181 | return FALSE; |
| 182 | /* already erodeproof or cannot be eroded */ |
| 183 | if (otmp->oerodeproof || !erosion_matters(otmp) || !is_damageable(otmp)) |
| 184 | return FALSE; |
| 185 | /* part of a monster's body and produced when it dies */ |
| 186 | if (otmp->otyp == WORM_TOOTH || otmp->otyp == UNICORN_HORN) |
| 187 | return FALSE; |
| 188 | /* artifacts cannot be generated eroded */ |
| 189 | if (otmp->oartifact) |
| 190 | return FALSE; |
| 191 | return TRUE; |
| 192 | } |
| 193 | |
| 194 | /* random chance of applying erosions/grease to object */ |
| 195 | staticfn void |
no test coverage detected