Bug - Fixed Clover Protection does not activate after chained choice

AlbinoRhino

Active member
I believe there is a related issue with these fights with clover protection. (God Lobster, Doc Bag, Use the Force, Professor Relativity?, etc.). If you are under the Marmot sign and a clover drops while fighting the God Lobster, for instance, mafia cannot immediately disassemble it then and does not disassemble it when it subsequently becomes possible (though cloverProtectActive is true throughout).
Perhaps this should be a separate bug report?
 

Veracity

Developer
Staff member
Revision 19903 does this.

If you are in a fight or a choice or in a choice follows fight situation, we mark the clover as deferred. Next time we decide we need to protect clovers, it will disassemble it for you. That SHOULD include exiting from the last choice in a choice chain.

I don't have Marmot, so have not tested, except to verify that clover protection still works for normal cases.
 
For the past few days, my god lobster automation has been failing, but only on one fight, and not every day, and I noticed today that I got a marmot clover in that failing fight.
So this fix was either unsuccessful or it broke when the choice handling was changed (with the creation of the choiceAdventure script or the automatic choice.php visit for chains).

Fight 1 today: https://i.imgur.com/ladyPJ5.png
vs Fight 2 today (which had the clover drop): https://i.imgur.com/mz1Wmi1.png

I already did my fights today, but I'll get a debug log tomorrow.

Edit: the script-snippet that's handling my god lobster fights, in case it matters:
Code:
while(get_property_int("_godLobsterFights") < 3 ) {
	BetweenFights(1,true);
	set_location($location[none]);
	use_familiar($familiar[god lobster]);
	int selected = SelectGodLobster();
	clear(requiredEquips);
	requiredEquips[lobster_rewards[selected].famequip] = true;
	FreeDrops(requiredEquips,$monsters[none],true,false,"exp, 0.25 mainstat, 1500 max"); // this includes the maximizer call you can see in the screenshot
	page = visit_url("main.php?fightgodlobster=1");
	run_combat();
	if ( choice_follows_fight() ) {
		run_choice(lobster_rewards[selected].choice);
		visit_url("main.php");
	}
	else
		abort("No Choice after a god lobster fight? That doesn't make any sense.");
}
 
Last edited:

Veracity

Developer
Staff member
I'll try automating the God Lobster tomorrow.

That's not an "adventure" so I don't think that clover protection has ever been intended to work in that case, but the "a choice follows this fight immediately", although it is correct, seems undesirable to log; it should have automated right through it.
 

Veracity

Developer
Staff member
FWIW, here is my God Lobster automation. I should use choice_follows_fight(). :)

Code:
void god_lobster_fights()
{
    if ( !have_god_lobster ) {
	return;
    }

    int fights = 3 - get_property( "_godLonsterFights" ).to_int();
    if ( fights <= 0 ) {
	return;
    }

    // Neither Meat Drop nor Item Drop matters for these fights.
    // Put on something, at least.
    outfit( farm_outfit );
    use_familiar( GOD_LOBSTER );

    // First goal is to acquire all the pieces of regalia.  Once you
    // have them all, equip the crown and choose "experience", which
    // will also give you a dish of clarified butter
    while ( fights > 0 && my_adventures() > 0 ) {
	// Choose which item to equip
	int scepters = available_amount( GOD_LOBSTER_SCEPTER );
	int rings = available_amount( GOD_LOBSTER_RING );
	int rods = available_amount( GOD_LOBSTER_ROD );
	int robes = available_amount( GOD_LOBSTER_ROBE );
	int crowns = available_amount( GOD_LOBSTER_CROWN );
	item familiar_item =
	    ( crowns > 0 ) ? GOD_LOBSTER_CROWN :
	    ( robes > 0 ) ? GOD_LOBSTER_ROBE :
	    ( rods > 0 ) ? GOD_LOBSTER_ROD :
	    ( rings > 0 ) ? GOD_LOBSTER_RING :
	    ( scepters > 0 ) ? GOD_LOBSTER_SCEPTER :
	    NO_ITEM;
    
	// If unspecified, use whatever the familiar is already wearing
	if ( familiar_item != NO_ITEM ) {
	    equip( familiar_item );
	}

	between_battle_checks();
	string page = visit_url( "main.php?fightgodlobster=1" );
	if ( !page.contains_text( "fight.php" ) ) {
	    // Unexpected
	    break;
	}

	combat_filter_setup( NO_LOCATION );
	page = run_combat( "default_filter" );
	fights--;

	if ( !page.contains_text( "choice.php" ) ) {
	    // Unexpected. Perhaps you lost the fight?
	    continue;
	}

	page = visit_url( "choice.php" );

	// Options 1, 2, or 3 - unless you are wearing the crown, in
	// which case the "regalia" option is not available and the
	// others are 1 and 2. We'll go for "experience"
	// 
	// "I'd like part of your regalia."
	// "I'd like a blessing."
	// "I'd like some experience."

	int option = ( familiar_item == GOD_LOBSTER_CROWN ) ? 2 : 1;
	run_choice( option );
    }
}
 

Veracity

Developer
Staff member
Oh, ha. Try revision 19948. I had a typo and my check on whether to protect clovers actually aborted, rather than silently checking.
 
Top