Feature - Implemented Add 2010 April Fools' familiars to mafia data

zarqon

Well-known member
I'm looking to add support for the tiny costume wardrobe to BatBrain -- detecting the image of the familiar which is swapped to and matching it against $familiar[<name>].image (or something like that). One of the stumbling blocks is that possible familiars include the April Fools' Day familiars, which mafia doesn't include as valid familiars.

The Wiki mentions "it is currently theorized that #125-133 are the nine 2010 April Fool's Day familiars." Which would give you a placeholder familiar number for them -- and if these numbers are later shown to be incorrect or just shuffled wrong, it's an easy fix.

Hatchling should probably be $item[none], although an alternative would be to list it as some impossible item.
 

Bale

Minion
I think you'd better just hardcode exceptions for those familiar images since there's so much speculation required to add the familiars that are not familiars.
 

Veracity

Developer
Staff member
I'd also like to point out that familiar images are wonky: we don't have them in familiars.txt, but detect them when we see them in your terrarium. We really should add them to the data file. One more thing to add when we add a new familiar, but it's something we can automatically detect when we detect a new familiar in your Terrarium, so no big deal.

I really dislike putting speculative data into the data files. Like, guessing that these empty familiar slots correspond to such-and-such a familiar. I can certainly believe that the range of 9 unknown familiars corresponds to the 9 April Fool familiars. I just wish I knew which familiar was which number.
 

Bale

Minion
I can certainly believe that the range of 9 unknown familiars corresponds to the 9 April Fool familiars. I just wish I knew which familiar was which number.

I think that zarqon's point is that it doesn't matter if the order is incorrect and if it ever does matter, then it will be spadeable and easily fixed.

Yeah though, I also dislike putting weird guesses into mafia even if, like this one, a mistake won't break anything.
 

zarqon

Well-known member
The main issue for me is that they are familiars, yet mafia can't recognize them. If I have a familiar variable, what can I put in that variable to indicate one of these familiars? It's not something easily hard-coded, since an entirely different type must be used -- meaning magic numbers or strings. All the functions that deal with familiars would have to convert to and from magic numbers instead -- they couldn't actually return a familiar or accept one as a parameter without data loss.

Also, the familiar category in batfactors is presently indexed by familiar number (all categories are indexed by number, actually), so not using numbers would require either using arbitrary integers or including a separate map.

In short, the code ugliness required to "hardcode" these familiars makes adding support not worth it. Variable types should mean something.

An alternative solution would be for my_familiar() to return the transformed familiar during combats, but I suspect that would be a lot more work for the devs (and more controversial).

ETA: The main reason it's important for BatBrain to know about these familiars is that some of them have negative effects, which could lead to player death or other unwanted consequences if not accounted for. Unknown positive effects are Not a Big Deal, because hey, free positive effect.
 
Last edited:

Bale

Minion
So, mostly what you want is for $familiar[Egg Benedict] to be a valid value, along with the others. Unfortunately it isn't possible to implement that without granting a familiar number, so...

Well, that does seem like a reasonable thing to me.
 

Veracity

Developer
Staff member
He wants all the April Fools familiars to be valid, complete with .image proxy fields - which, as I said, are heuristically determined now, not in familiars.txt.

Step one would be to add a field to familiars.txt for the image, set the image for all know familiars (easily determined from the familiar description page, I suspect), and get rid of all the kludgy heuristics - which are there only to avoid having the image be in the data file...

That's been bugging me for a while, anyway, since if you go to the Familiar Trainer and one of the opponents is a familiar you don't have, the familiar trainer can't currently show you the correct image of the opponent.
 

zarqon

Well-known member
I could probably parse the name from the transformation text just as easily. Mainly I just want them to be valid $familiar values. If you'd rather assign them to familiar numbers -1 to -10 that's fine by me.

The Eye also has a negative effect during combat.
 

Veracity

Developer
Staff member
Revision 9644 should make your life easier:

- I added the 9 April Fool familiars
- If you have a doppelshifter or tiny costume wardrobe equipped, we notice when the familiar image changes and set your "effective" familiar to what the image tells us.
- ASH function: familiar my_effective_familiar() is your effective familiar - the same as your current familiar when your familiar is not shifted (always, except in the cases I mentioned).
 

Bale

Minion
It must be zarqon's birthday because this was a great present Veracity just gave him. He even got an ash function so he won't have to parse the combat text!

Veracity rocks.
 

Veracity

Developer
Staff member
Thanks!

I hope it works to his satisfaction. I tell you, it was very satisfying to take my coffee pixie with costume wardrobe into the Giant Castle and see the image change into a Pet Cheezling in the green sidepane during the battle - and the corresponding item & meat drops change in the modifier display - and then back to a coffee pixie again when the battle was over.

There may very well be bugs, but my initial testing went well.
 

zarqon

Well-known member
Wow! Beyond my hopes!

I can remove a good chunk of the code I was adding to BB and SS now -- good thing I didn't post an update yet!

Since "people with Comma Chameleons" doesn't include me, I'm quite content to consider familiar tracking in BB done now -- and I didn't even have to do it! Thanks much Veracity!
 

zarqon

Well-known member
One more post to say wow -- this is ridiculously awesome. I'm adventuring with a costume wardrobe right now and watching a) the image changing in the character pane, and 2) SS making smart decisions based on the swapped familiar. Incredible.

EDIT: This is also very useful for finding syntax errors in batfactors.txt for familiars I don't have.
 
Last edited:

lostcalpolydude

Developer
Staff member
I was able to determine the order for these familiars.

125 Money-Making Goblin
126 Floating Eye
127 Vampire Bat
128 Oyster Bunny
129 Egg Benedict
130 Bank Piggy
131 Worm Doctor
132 Snowhitman
133 Plastic Grocery Bag

I guess it would break at least one script to make those accurate. The method for checking those has been closed, so there's no way to confirm them. Also, Vampire Bat is not a typo.
 
Top