Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't get hippy disguise for L12 quest if you already have the frat war gear #1101

Open
Theophrastus-on-git opened this issue Mar 25, 2022 · 3 comments

Comments

@Theophrastus-on-git
Copy link
Contributor

Context

  • KolMafia version: 26308
  • Class: Actually Ed
  • Run type (Casual/Normal/Hardcore/Aftercore): HC
  • Challenge Path (Standard/Path Name/None): Ed
  • Number of Ascensions:

Expected/Desired Behavior

Check for frat war outfit before getting hippy disguise.

Current Behavior

Autoscend acquires the filthy hippy disguise for the L12 quest even if you already have the war outfit.

Failure Information (for bugs)

@CyberfoxStudios
Copy link
Contributor

Started looking into this.

Relevant script:
https://github.com/Loathing-Associates-Scripting-Society/autoscend/blob/a00e812fcb031cdcef61c4b5b82177ecf00c2f82/RELEASE/scripts/autoscend/quests/level_12.ash

Relevant task / func:
boolean L12_getOutfit()

Code Looks:
To determine if there's already an outfit, there's a lot of calls to haveWarOutfit(), which is a shell function for haveWarOutfit(false), which then calls possessOutfit which I haven't checked out yet.

boolean haveWarOutfit(boolean canWear)
{
	if(!get_property("auto_hippyInstead").to_boolean())
	{
		return possessOutfit("Frat Warrior Fatigues", canWear);
	}
	else
	{
		return possessOutfit("War Hippy Fatigues", canWear);
	}
	return true;
}

boolean haveWarOutfit()
{
	return haveWarOutfit(false);
}

Then there's later a call after pulling (which wouldn't happen on a HC run) to use Hippy Disguise to get Frat Outfit.

// if outfit could not be pulled and have a [Filthy Hippy Disguise] outfit then wear it and adventure in Frat House to get war outfit
	if(auto_warSide() == "fratboy" && possessOutfit("Filthy Hippy Disguise"))
	{
		autoOutfit("Filthy Hippy Disguise");
		//r25671 this should be [Frat House In Disguise] but due to mafia issue it currently needs to be as below
		return autoAdv($location[Frat House]);
	}

Need to check what possessOutfit does next.

@CyberfoxStudios
Copy link
Contributor

So here is possessOutfit from auto_equipment.ash. Single parameter call is another shell func that feeds false into the below:

boolean possessOutfit(string outfitToCheck, boolean checkCanEquip) {
	// have_outfit will report false if you're wearing some of the items
	// it will only report true if you have all in inventory or are wearing the whole thing
	// hence this now exists.
	if (count(outfit_pieces(outfitToCheck)) == 0) {
		auto_log_warning(outfitToCheck + " is not a valid outfit!");
		return false;
	}
	
	foreach key, piece in outfit_pieces(outfitToCheck) {
		if (!possessEquipment(piece))
		{
			return false;
		}
		if(checkCanEquip && !can_equip(piece))
		{
			return false;
		}
	}
	return true;
}

So the false 2nd parameter feed is pretty standard, almost an 'override' for the default !can_equip(piece) check.

@CyberfoxStudios
Copy link
Contributor

Stepping through L12_getOutfit() now that I have some context.

  1. If the war is started, don't need a disguise.
  2. If have the war outfit corresponding to settings, don't need a disguise. This is the Frat Warrior Fatigues if setting auto_HippyInstead is not selected, else it is the War Hippy Fatigues.
  3. Try to pull war outfit, check if successful.
  4. If you still need a war outfit, and have the disguise for the opposing side, equip that disguise then adventure for the outfit. Example: Frat Side -> Hippy Disguise -> Frat House Adv
  5. If you don't have a disguise, run new task L12_preOutfit() to get disguise.

So there IS a check for the Frat War Outfit in 2 (haveWarOutfit()) before trying to get the disguise in 5.
This check depends upon auto_HippyInstead being off, but otherwise I can't see anything that might cause the reported issue. I also don't see anything on the Ed run wiki that would mess with this.

I'd say this warrants an attempt at replication before further code investigation. Unfortunately I have no plans to do a hardcore Ed run anytime soon, so this wraps up my poking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants