Feature - Rejected numeric_modifier (or some new function) to look at the enchantments of bjorn/crown familiars

Right now mafia (and the maximizer) has information about the enchantments that the Buddy Bjorn and Crown of Thrones give when a familiar is bjornified or enthroned, respectively. This information gets used in the maximizer, but doesn't appear to be exposed through any API that scripters can use; checking
JavaScript:
numericModifier(Item.get("Buddy Bjorn"), "Familiar Weight")
when it is equipped and a Misshapen Animal Skeleton is in my bjorn yields 0, as does
JavaScript:
numericModifier(Familiar.get("misshapen animal skeleton"), "Familiar Weight", 1, Item.get("Buddy Bjorn"))
which was admittedly a longshot anyways.

One option would just be to have numericModifier pay attention to our currently enthroned/bjornified familiar when being used on the crown or bjorn; the disadvantage of this is it requires the player to enthrone/bjornify a familiar every time they want to check its prospective enchantment; it's intuitive, but cumbersome.
Another would be to make a new override for numericModifier:
Code:
numericModifier(familiar: Familiar, modifier: string)
. This is awfully similar to the one used for active familiars, but lacks the weight and familiar-equipment parameter. It also isn't immediately obvious from the function-name or the signature that it's dealing with enchantments for the bjorn/crown specifically. This still feels like the best bet to me, although I'm not sure enough about the particularities of the code to know if it would be straightforward.

It could also be a newfunction as opposed to a numericModifier override, with the same signature listed above. It has the advantage of, depending upon the specific name chosen, feeling specific to the bjorn+crown, making it a little more obvious what the function does.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
JavaScript:
numericModifier("Throne:Barrrnacle", "Familiar Weight") === 5
 

Veracity

Developer
Staff member
From modifiers.txt:

Code:
Throne    Adorable Seal Larva    HP Regen Min: 2, HP Regen Max: 8, MP Regen Min: 2, MP Regen Max: 8, Drops Items
Throne    Adorable Space Buddy    Maximum HP: 30, Maximum MP: 30, MP Regen Min: 10, MP Regen Max: 12
Throne    Adventurous Spelunker    Item Drop: +15, Drops Items, Variable
...

and so on.

Code:
> ash numeric_modifier("Throne:Adorable Space Buddy", "Maximum HP")

Returned: 30.0
 
Top