Bug - Fixed adjusting familiar weight

I noticed recently that at the end of (almost) every battle, I get the text "Adjusting familiar weight by -x pounds" where X starts at 1 and slowly grows over the course of my turns.

I'm using my stocking mimic, I'm not sure if it's happening with my other familiars.
As far as I can tell, I'm not doing anything out of the ordinary. Familiar is wearing the bag of many confections, and I have some basic +familiar weight (Sympathy, Empathy, sometimes a Pith helmet)

Any ideas on what's causing this?

Watching carefully, at the end of battle, my familiar weight in the mafia left-hand panel flickers briefly to the higher, inaccurate, weight.
 

lostcalpolydude

Developer
Staff member
Did you ever have curiosity active? I would guess that mafia thinks your familiar gained experience when it didn't. I saw the same thing when I didn't wear the bag of confections and relied on candyblast to get candy for mimic weight.
 

slyz

Developer
If Mafia properly recognizes all you +familiar and +familiar experience effects when you do "modtrace familiar weight" or "modtrace familiar experience", it's probably because Mafia thinks you familiar has more experience that it actually does.

Does the message go away after you visit your terrarium?

EDIT: Lost's explanation makes sense too.
 
If Mafia properly recognizes all you +familiar and +familiar experience effects when you do "modtrace familiar weight" or "modtrace familiar experience", it's probably because Mafia thinks you familiar has more experience that it actually does.

Does the message go away after you visit your terrarium?

EDIT: Lost's explanation makes sense too.

modtrace familiar lists only the things I'd expect it to list. Which doesn't include Curiosity. I do my switching via chat, but I'm fairly certain I've visited the terrarium at least a few times to ensure that I do indeed have the bag of confections equipped. Tonight I'll see if it fixes it... the same thing has happened three days in a row though, so I don't think mafia is confused about familiar experience (CHIT displays proper exp)
 

slyz

Developer
Mafia scrapes your familiar's total experience when you visit familiar.php, but only scrapes the weight from charpane.php. Mafia then adds any experience gained, and the weight of a familiar is calculated internally based on that.

If the initial experience is wrong, the weight is wrong and Mafia will print a message each time it loads the charpane.
If the initial experience is right, but the wrong amount of experience is added at each combat/noncombat, the weight ends up being wrong and Mafia will print a message each time it loads the charpane.

Visiting the terrarium resets the familiars' experience in Mafia. If, after visiting the terrarium, familiar_weight( $familiar[ stocking mimic ] ) gives the wrong base weight, something must be wrong with the familiar.php parser. Otherwise, Mafia is adding too much familiar exp for some reason.
 
Okay, so revisiting the terrarium fixes it, and it looks as though mafia just thinks I'm gaining 2 experience per fight rather than one, though I have no idea why it's thinking that. Modtrace familiar shows nothing for familiar experience, I'm not using any love songs or anything in battle. Anything I can do to test?
 

lostcalpolydude

Developer
Staff member
In FightRequest, there's
PHP:
		if ( won )
		{
			KoLCharacter.getFamiliar().addCombatExperience( responseText );
		}
which adds experience at the end of the fight, regardless of your familiar, including things like curiosity. Later on there's
PHP:
			// <name> gorges himself on candy from his bag.
			if ( responseText.indexOf( "gorges himself on candy from his bag" ) != -1 )
			{
				familiar.addNonCombatExperience( 1 );
			}
			break;
which will add 1 experience to the mimic. I believe
PHP:
		if ( won )
should be
PHP:
		if ( won && ( KoLCharacter.getFamiliar().getId() != FamiliarPool.STOCKING_MIMIC ) )
since the mimic only gets experience in combat when it gorges itself, and all +familiar experience things are ignored under all circumstances.

Edit: That doesn't compile, something about non-static and static stuff not being usable together, but that's the idea of what's needed at least..

Edit2: Compiler error fixed.
 
Last edited:
Top