User:Tjr/object generation spoiler
Legwork for an 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.
Contents
Containers
Contents of containers are complicated, not just rn2(..) things: Mkobj.c#mkbox_cnts
Unless stated otherwise, all items can be containers, which hold more items.
In a normal rooms-and-corridor level at level creation time.
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, 4/5*(1/5)^n prob for n+1 objects, n>=0. Containers are eligible.
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 (20% chance anyway), non-special, and hitting a place to put the niche (unlikely to 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#mkshobj_at
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#line627 ff
still to track maze objects: mkmaze.c#line633
level descriptions can contain objects: Sp_lev.c#line934, Sp_lev.c#line951
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#line266. What happens if quan=0 is rolled?
Conduct-breakers
- Death drops mon.c#line1833
- Wishing. Objnam.c#readobjnam.
- Polypiling Zap.c#line1225
- Writing scrolls/books write.c#line161
Random Alchemy
Initial inventory
Saving and restoring
including bones files