Talk:Medical kit

From NetHackWiki
Jump to navigation Jump to search

What's up with letting a gelatinous cube eat the medical kit to get hold of all the pills with 100% chance? Tjr 13:56, December 24, 2009 (UTC)

It doesn't work; the gelatinous cube just eats the pills along with the medical kit (from testing in wizard mode) Ion frigate 22:14, December 24, 2009 (UTC)

I found a reliable way to extract pills from medkits: dig a pit, dump the kit in it, fill with a boulder, and since buried organics deteriorate (with 95% chance, see dig.c), in 250-500 turns bag rots away and you can dig pills out. (You also get useless bandages & phials this way.) Be careful though, pills are organic too, so after too long they will probably rot as well. Tomsod (talk) 22:43, 15 January 2017 (UTC)

As promised

The python script I wrote to simulate this. I haven't added the adjustment for boulders produced from wished-for scrolls of earth yet.

import random
wish_distr = {}
tries = 100000
ev = 0
def gen_and_use_kit():
    kit_size = random.randrange(1,60)
    wishes = 0
    pills = 0
    for x in range(kit_size):
        if random.randint(1,3) == 1:
            pills = pills + 1
    while pills > 0:
        if random.randint(1,49) < 7:
            wishes = wishes + 1
        pills = pills - 1
    return wishes
def update_wish_distr(wishes):
    if wishes in wish_distr.keys():
        wish_distr.update({wishes:  wish_distr[wishes] + 1})
    else:
        wish_distr.update({wishes: 1})

for i in range(0,tries):
    update_wish_distr(gen_and_use_kit())

for item in wish_distr.items():
    ev = ev + (item[0] * item[1])/tries

print(dict(sorted(wish_distr.items())))
print(ev)

As I said in the article, this produces 1.22 wishes per kit, which means you're going to be wishing for more kits most of the time. Probably not worth it in a real game. Also, the number of wishes is *really* variable - even at 100000 tries, I was getting 1-2% variation between runs. Runs of 1000 or less looked basically random. -Ion frigate (talk) 06:31, 1 November 2024 (UTC)