Yep, I figured it was something like that. I initally copied the switch from FTF's monster_value(), which ignores bounty items. I'd forgotten there was a separate type for that -- was thinking they were part of "c".
And while we're being picky, you were both a little off. It should be:
PHP:
case "b": res += temp; continue;
heeheehee's fix would have stopped counting goals whenever it considered any bounty item; Bale's solution would have considered all possible bounty items goals, even ones you weren't hunting.
To address other issues:
1)
Wormwood. Looking at session logs from a character farming !pipes, you appear to be correct. I was suspicious because I have a set_avg() hook in my wormwooding that tracks spare adventures. From three characters: 4.49:343 , 4.53:2440 , 4.45:331
So, over 3000 wormwood iterations says that you get an average of 4.5 adventures outside the Wormwood per absinthe. Of those, turns 10, 6, and 2 are always outside, leaving 1.5 to come from elsewhere. If 3 was also always outside, that would mean that turns 9, 8, 7, and 5, 4 would only average 0.5 turns outside the wormwood, giving only a 0.1666... chance (0.5 / 3) of encountering the choiceadv. Seemed less reasonable than a 0.375 chance (1.5 / 4), but session logs don't lie. Or at least, they lie less than my assumptions do.
2)
4-d camera usage check. Yes, excellent.
3)
to_element(). Oooh it's in ASH now! When did that happen? Unfortunately, this doesn't return $element[hot] for the word "heat" -- a common case. Everything has still been working -- evidently you can redeclare ASH functions? Which one gets executed? Curious.
4)
fight_items() recursion. Recursion was necessary a) because BBB is called once, before adventuring, not after fighting an item, and 2) to perform all the counter/goal checks again, efficiently. And if you think about it, I'm pretty sure you'll grasp why it doesn't recurse for unrepeatable combats.
5)
Bale's fix to has_goal(monster): Your addition of pickpocketing for normal drops had at least two problems. First, rec.rate is only the pickpocket rate for type "p"; for normal drops, it's the normal drop rate. Further, unlike regular drops, you can't get multiple items, so the sum pickpocketing goal-ness should be divided by the number of pickpocketable drops. And further yet, the formula for pickpocket chance is
far more complicated than regular item drops. Perhaps you understand now why I haven't added that yet. Your code would have yielded a
drastically overoptimistic result for moxie classes.
(Using this code and looking for white pixels as a DB with +45% items: has_goal(blooper) returned 4.97! What you say!)
The has_goal() bounty item problem is a rather glaring bug and will be fixed promptly. Other issues 1 and 2 will be in the next BBB update. I will remove/alter to_element() after I decide how/if this overloading of ASH functions works. Accounting for pickpocketing normal drops in has_goal() will happen someday, someday.
EDIT: Ok, so you can't redeclare ASH functions. They just get ignored. That should be an error, methinks. DDD is broken now for "heat" tests.