User talk:BLAcK PriNcE

160. /* check whether bones are feasible */ 161. boolean 162. can_make_bones 163. { 164.  	register struct trap *ttmp; 165. 166.  	if (ledger_no(&u.uz) <= 0 || ledger_no(&u.uz) > maxledgerno) 167. 	    return FALSE; 168. 	if (no_bones_level(&u.uz)) 169. 	    return FALSE;		/* no bones for specific levels */ 170. 	if (u.uswallow) { 171. 	    return FALSE;		/* no bones when swallowed */ 172. 	} 173.  	if (!Is_branchlev(&u.uz)) { 174. 	    /* no bones on non-branches with portals */ 175. 	    for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) 176. 		if (ttmp->ttyp == MAGIC_PORTAL) return FALSE; 177. 	} 178.  179.  	if(depth(&u.uz) <= 0 ||		/* bulletproofing for endgame */ 180.  	   (!rn2(1 + (depth(&u.uz)>>2))	/* fewer ghosts on low levels */ 181. #ifdef WIZARD 182. 		&& !wizard 183. #endif 184. 		)) return FALSE; 185. 	/* don't let multiple restarts generate multiple copies of objects 186. 	 * in bones files */ 187. 	if (discover) return FALSE; 188. 	return TRUE; 189. } 190.