User:Tjr/object generation spoiler

Object creation spoiler

This treats only those cases that aren't restricted to monster inventory items or certain useless items. It's mostly interesting for pacifists, as they don't get any death drops. Specifically, I wanted to know how likely a 12-conduct character is to find holy water, a scroll of scare monster, a magic whistle and so on.

Containers
Contents of containers are complicated, not just rn2(..) things: Mkobj.c

Unless stated otherwise, all items can be containers, which hold more items.

Death drops
mon.c Enough said.

In a normal rooms-and-corridor level at level creation time.
Mklev.c

You need the distribution of rooms per level, and room sizes

Random objects on the floor in each ordinary room.

 * ... chance of non-special room ...
 * 1/3 chance of a monsters, which might be a snake/spider.
 * (1/10 chance fountain, independently 1/60 sink for a ring, 1/60 altar ..)
 * 1/(80-2*depth) chance of one grave, which will hold rn2(5) cursed items
 * 1/(nroom * 5 / 2) chance of: 1/3 chest 2/3 large box
 * 1/3 chance of objects at all, 1/5*(4/5)^n prob for n objects, n>0. This includes containers.

make_niches

 * 1d(rooms/2 +1) proto-niches.
 * dlev 1-5: all, dlev 6-15: 5/6, dlev 16-24 25/36, dlev 25-end 5/6 are a non-trap niche.
 * 8 retries to find a room with !=1 door, non-special, and hitting a place to put the niche (can't really fail).
 * 3/4*6/7*1/3 of those get another random object, but they never have a secret door.

shops

 * 1<dlev<medusalevel && 45%chance &&	rn2(u_depth) < 3)
 * mkroom(SHOPBASE)
 * Each square has (dlevel-1)% chance of a mimic, else make a fitting object. Shknam.c

court room
1 chest
 * 4<dlev<castle && no shop && 1/6 chance

graveyard boxes

 * 11<dlev<castle && noshop && 5/6*7/8*6/7*4/5*4/5*1/6
 * each square has 1/10 chance of 2/3 large box, 1/3 chest

barracks containers

 * 14<dlev<castle && noshop && 5/6*7/8*6/7*4/5*4/5*5/6*7/8*1/4
 * each square has 1/20 chance of 2/3 large box, 1/3 chest

cockatrice nest statues

 * 16<dlev<castle && noshop && 5/6*7/8*6/7*4/5*4/5*5/6*7/8*3/4*5/6*1/8
 * each square has 1/3 chance of statue with rn2(5) items

Special levels etc
special levels, a bizarre case, mines levels, quest filler, post-Medusa maze, rogue level: Mklev.c ff

still to track maze objects: mkmaze.c

level descriptions can contain objects: Sp_lev.c, Sp_lev.c

Monsters

 * Spiders and snakes get a random object in makelevel.
 * Quantum mechanic boxes are always empty. makemon.c:963
 * Player monsters (Astral Plane, Quest) get rn2(10) objects, possibly with contents. Mplayer.c. What happens if quan=0 is rolled?

Conduct-breakers

 * Wishing. Objnam.c
 * Polypiling Zap.c
 * Writing scrolls/books write.c

Random Alchemy
Potion.c

Initial inventory
U_init.c

Saving and restoring
including bones files