Feature - Implemented Book of Facts: Monster Items/Effects/Etc

I'm 80% sure there isn't a thread for this. Which is fine! The item is 90% implemented.

But there is a missing 10%. When you have the Book of Facts (or, more accurately, the skill "Just the Facts"), fighting monsters gives various things: some monsters drop items, others give effects, and so on. This is done in the classic seeded-random way we have all come to know and love, and we're pretty much done spading it.

This website can be used to check out the expected results of a particular seed; its source code can be found here, and this is a spreadsheet consisting of spading data for it.


Pocket wishes can drop at most thrice a day, so we'll need a pref for that. Tattered scraps can drop at most 11, so ditto. My understanding is that meat drop is equal to the base meat drop of the monster.

I'm unfortunately not personally perfectly well-versed on the exact nature of what all this thing does, but I figured it would be helpful to start a discussion. What should support for this look like?

In scope, the Cargo Cultist Shorts seems like the closest analogue--it drops a lot of stuff, and in particular it drops a variety of things: items, monsters, meat, etc. Following that model, we'd want a variety of functions, like
Code:
Item just_the_facts_item(monster)
Item just_the_facts_item(monster, class, path)
Effect just_the_facts_effect(monster)
Effect just_the_facts_effect(monster, class, path)
String just_the_facts_drop(monster)
String just_the_facts_drop(monster, class, path)
The idea here is the one-argument version of the function examines your current seed, and the three-arg version examines the seed specified by the latter two arguments.
 

Semenar

New member
How the seeding works:
There exist several lists of possible effect groups: one common and one for each phylum. They can be extracted from the code above, starting from here - effect groups with more than one effect are written as arrays.

First, calculate the seed: seed = 421 * classid + 11 * pathid + monsterid.
Determine whether the effect will be a common one or a phylum-specific one.
If in the Shrunken Adventurer path and the phylum is Bugs, take the value of seed % 2. Otherwise, take seed % 3. If the taken value is equal to 1, the effect is phylum-specific, otherwise it is a common one.

Roll on the respective list of effects (common or phylum-specific) using mt_rand, seeded with the seed. Pick a single number between 0 and the length of the list minus 1, this is the resulting effect group.

Some effect groups have several possible outcomes within them. For instance, the "worthless items" group has three possible outcomes - different worthless items. If this is the case, roll again on the list of sub-effects using mt_rand, seeded with seed + 13. There are two exceptions:
- Heap drops are seeded with seed + 11 instead.
- Meat drop from a Penguin-specific effect is determined as 100 + mt_rand(0, 50), where the random is seeded using seed + 12.
 
Last edited:
Perhaps the incorrect place for this, but prefs for number of wishes we've gotten and number of tatters we've gotten would also be nice

Pocket wish drops are capped at 3 per day
And tattered scraps of paper are capped at 11
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
This is now implemented. I'll document in the wiki (if someone else hasn't already!) when I can fit it around baby duties.

Check out the fact_type and fact proxy fields on Monster and the fact_type, item_fact, effect_fact, numerical_fact and string_fact functions
 
I just had a sort of funny bug. I backed up a Knob Goblin Embezzler against a Bigface as a Pastamancer in aftercore, and at the end of combat:

After Battle: There's a compound in the blood of this particular creature that acts as a potent medicine.
Preference _bookOfFactsWishes changed from 0 to 3
Embezzler is, as you can see, not a pocket wish monster. But bigface is! So backup is messing this up a little, it seems. It's worth mentioning that this fight was submitted as a single combat macro that was an autoattack, which might? impact mafia's ability to follow the backup changes?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
As in you turned a bigface into an embezzler? Ok. I assume it was a macro fight? Can you get me some debug html?
 

Erosion

Member
Recall Circadian Rhythms gives a max of +11 RO advs, not +10
The initial fight should also be counted
 
Top