Bug - Not A Bug numericModifier() reporting inaccurate values for certain familiars

Code:
> js numericModifier(Familiar.get("Leprechaun"), "Leprechaun", 1, Item.get("none"))

Returned: 0.0

> js numericModifier(Familiar.get("Cornbeefadon"), "Leprechaun", 1, Item.get("none"))

Returned: 0.0

> js numericModifier(Familiar.get("Robortender"), "Leprechaun", 1, Item.get("none"))

Returned: 1.0

> js numericModifier(Familiar.get("Hobo Monkey"), "Leprechaun", 1, Item.get("none"))

Returned: 1.25

> js numericModifier(Familiar.get("Baby Sandworm"), "Sombrero", 1, Item.get("none"))

Returned: 0.0

At first, I wasn't sure if I was using the modifier in an inappropriate context, or if something had gone awry, but the last example makes me pretty convinced that this is unintended behavior--the wiki specifically lists the Baby Sandworm as an example of a familiar that should return 1.0 for Sombrero.

If this is intended behavior, please let me know and I'll disappear with my tail between my legs.

EDIT: to be clear, it is returning an accurate value for the Robortender and the Hobo Monkey, those were just meant to show that it doesnt' categorically return 0.

EDIT 2: Further investigation suggests that this is probably intended behavior. Whoops!
 
Last edited:

heeheehee

Developer
Staff member
Yeah. From modifiers.txt:

Python:
# Familiars with standard abilities don't need to appear here -
# familiar.txt types of stat0, stat1, item0, meat0 correspond to
# modifiers Volleyball, Sombrero, Fairy, Leprechaun, with a default
# value of 1.

Admittedly, this is somewhat confusing behavior. Might I suggest instead using the resulting modifiers, e.g. Meat Drop or Experience?

PHP:
foreach f in $familiars[leprechaun, cornbeefadon, hobo monkey] {
  print(f + ": " + numeric_modifier(f, "Meat Drop", 1, $item[none]));
}

foreach f in $familiars[hovering sombrero, baby sandworm, blood-faced volleyball] {
  print(f + ": " + numeric_modifier(f, "Experience", 1, $item[none]));
}

yields...

Code:
Leprechaun: 10.832396974191326
Cornbeefadon: 10.832396974191326
Hobo Monkey: 13.083123951777
Hovering Sombrero: 1.0
Baby Sandworm: 1.0
Blood-Faced Volleyball: 2.2
 
Yeah, that works. There is utility in being able to get the multiplier as opposed to the direct modifier, but I can always backsolve.
 

ckb

Minion
Staff member
You can also get familiar 'type' from familiars.txt

Code:
familiars.txt
none - does nothing
stat0 - vollyball-like
stat1 - sombrero-like
item0 - Item Drop
meat0 - Meat Drop
combat0 - Physical Attack
combat1 - Elemental Attack
drop - special drop
block - potato-like
delevel - barrrnacle-like
hp0 - restore hp during combat
mp0 - restore mp during combat
meat1 - drops meat during combat
stat2 - grants stats during combat
other0 - does other things during combat
hp1 - restore hp after combat
mp1 - restore mp after combat
stat3 - grants stats after combat
other1 - does other things after combat
passive - passive effect
underwater - breaths underwater
variable - varies according to equipment or other factors
 
Top