Bug - Fixed Adventure automation & Sugar shield

Hello.

I discovered this forum only today, but I used Mafia long time before there, unaware of official forum. I tried to check existing threads, but I am sorry, if I missed something. Also, sorry for possible bad English - I am Russian.

Now to business! :)

Now and again I am using different automation scripts that I put in "custom combat scripts" for different deeds. It works as expected always... but not in case of Sugar shields.

I am set Choice Advs->Breakable Equipment->re-equip from inventory, or abort. And it works during adventure process as expected.

But when adventures ends, Mafia removes shield! There is no any explanation, simply "unequip familiarequip" in log. I didn't asked for that! Not very bad, if it's at the end of the day (but still annoying), but very inconvenient if I automated, like, 20 adventures.

Is this some programmable behavior or bug? And if it's first: how can I change it?

Thank you beforehand.
 

Theraze

Active member
There's a bunch of reports/chatting about this, but I can't find them currently. Probably because the issue is so longstanding. Anyways if I remember properly the symptoms are that if you're in adventure automation and a breakable item is replaced, the "what should be equipped" snapshot happens then, with the item broken. Like a quick internal checkpoint is being made, and restored when automation is done.

The fix was something weird, like setting/clearing outfit checkpoints in a between/after battle script, which breaks other things, like actually using checkpoints. But fixes this issue.

So yes, still a bug, unless it's actually been fixed and I'm remembering pre-fix behaviours.
 

Alhifar

Member
From my experience, just equip a sugar item, turn on "acquire and re-equip" for breakable handling, and then automate enough adventures to break the sugar item and have it replaced. When the automation ends, the sugar item will be unequipped.
 

Bale

Minion

I'm good at that! Here goes.


1. Set item preference for "Breakable Equipment" to "re-equip from inventory, or abort"
2. Acquire 2 sugar shield
3. Equip sugar shield
4. Check sugarCounter4183. When this goes to 31 the shield will be break.
5. Go to the Adventure tab and adventure in a location without non-combats for a number of turns equal to 31 - sugarCounter4183.

That will produce output like this:

Code:
[color=olive]> acquire 2 sugar shield[/color]

Taking off sugar shield...
Equipment changed.
Verifying ingredients for sugar shield (1)...
Searching for "sugar sheet"...
Search complete.
Purchasing sugar sheet (1 @ 215)...
You acquire an item: sugar sheet
Purchases complete.
You acquire an item: sugar shield
Successfully created sugar shield (1)

[color=olive]> equip sugar shield[/color]

Putting on sugar shield...
Equipment changed.
Validating adventure sequence...

[color=olive]> get sugarCounter4183[/color]

30

Validating adventure sequence...

Visit to Manor0: Haunted Wine Cellar (Northwest) in progress...

[75059] Haunted Wine Cellar (Northwest)
Encounter: possessed wine rack
Strategy: attack with weapon
Round 0: multi wins initiative!
Round 1: multi executes a macro!
Round 1: multi attacks!
Round 2: possessed wine rack takes 1563 damage.
Round 2: multi wins the fight!
After Battle: Grot does a couple of karate moves, then swivels his hips and gyrates his pelvis.
You acquire an item: dusty bottle of glassy Merlot
You acquire an item: dusty bottle of vinegar Marsala
You acquire an item: dusty bottle of spooky Muscat
You gain 21 Strongness
You gain 11 Enchantedness
You gain 12 Roguishness
You acquire an item: sugar shard (2)
Your sugar shield shattered.
Putting on sugar shield...
Equipment changed.

Taking off sugar shield...
Equipment changed.
 
Last edited:

roippi

Developer
Geez, finally figured out what was doing this. I was going nuts as I was thinking it was some sort of object equality issue (nope) or that creating an implicit checkpoint asks for the specific familiar equip rather than one of the equip (nope). Then I looked into EquipmentManager.breakEquipment(), which at some point calls this in SpecialOutfit:

Code:
	/**
	 * Method to replace a particular piece of equipment in all active checkpoints,
	 * after it has been transformed or consumed.
	 */

	public static final void forgetEquipment( AdventureResult item )
	{
		AdventureResult[] checkpoint;
		for ( int i = SpecialOutfit.implicitPoints.size() - 1; i >= 0; --i )
		{
			checkpoint = (AdventureResult[]) SpecialOutfit.implicitPoints.get( i );
			for ( int j = 0; j < checkpoint.length; ++j )
			{
				if ( item.equals( checkpoint[ j ] ) )
				{
					checkpoint[ j ] = EquipmentRequest.UNEQUIP;
				}
			}
		}
		for ( int i = SpecialOutfit.explicitPoints.size() - 1; i >= 0; --i )
		{
			checkpoint = (AdventureResult[]) SpecialOutfit.explicitPoints.get( i );
			for ( int j = 0; j < checkpoint.length; ++j )
			{
				if ( item.equals( checkpoint[ j ] ) )
				{
					checkpoint[ j ] = EquipmentRequest.UNEQUIP;
				}
			}
		}
	}

Aha. Not sure precisely how I want to fix it yet but at least the problem is identified.
 
Top