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

LoL dailies & enabling Deck #1303

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

SaucedButLeaking
Copy link

@SaucedButLeaking SaucedButLeaking commented Jun 5, 2023

Description

Adding pull support for breathitin, homebodyl, and keepsake boxes since LoL has pulls left over every day. Also includes basic ("it exists") support for the 2002 catalog and an attempt to see if replica Deck "just works" (it does not)

How Has This Been Tested?

Ran it turn 0, re-entered gracefully

use 1 infinite BACON machine
You acquire BACON (100)
Preference _baconMachineUsed changed from false to true
Preference _concoctionDatabaseRefreshes changed from 36 to 37

cast 1 That's Not a Knife
You acquire an item: boot knife
Preference _discoKnife changed from false to true
> [INFO] Trying to pull 1 of Breathitin™

pull: 1 Breathitin™
Preference _roninStoragePulls changed from 9025 to 9025,10830
Preference _concoctionDatabaseRefreshes changed from 37 to 38
Preference auto_pulls changed from (1:infinite BACON machine:0) to (1:infinite BACON machine:0), (1:Breathitin™:0)

chew 1 Breathitin™
Preference breathitinCharges changed from 0 to 5
Preference _concoctionDatabaseRefreshes changed from 38 to 39
> [INFO] Trying to pull 1 of Homebodyl™

pull: 1 Homebodyl™
Preference _roninStoragePulls changed from 9025,10830 to 9025,10828,10830
Preference _concoctionDatabaseRefreshes changed from 39 to 40
Preference auto_pulls changed from (1:infinite BACON machine:0), (1:Breathitin™:0) to (1:infinite BACON machine:0), (1:Breathitin™:0), (1:Homebodyl™:0)

chew 1 Homebodyl™
Preference homebodylCharges changed from 0 to 11
Preference _concoctionDatabaseRefreshes changed from 40 to 41
> [INFO] Trying to pull 1 of smut orc keepsake box

pull: 1 smut orc keepsake box
Preference _roninStoragePulls changed from 9025,10828,10830 to 9025,10828,5788,10830
Preference _concoctionDatabaseRefreshes changed from 41 to 42
Preference auto_pulls changed from (1:infinite BACON machine:0), (1:Breathitin™:0), (1:Homebodyl™:0) to (1:infinite BACON machine:0), (1:Breathitin™:0), (1:Homebodyl™:0), (1:smut orc keepsake box:0)

use 1 smut orc keepsake box
You acquire raging hardwood plank (4)
You acquire an item: morningwood plank
You acquire an item: long hard screw
You acquire messy butt joint (2)
You acquire thick caulk (2)
Preference _concoctionDatabaseRefreshes changed from 42 to 43
> [INFO] Turn(0): Starting with 40 left and 16 pulls left at Level: 1
> [INFO] Encounter: 0.0   Exp Bonus: 2.1
> [INFO] Meat Drop: 50.0	 Item Drop: 45.0
> [INFO] HP: 21/21, MP: 2/2, Meat: 1982
> [INFO] Tummy: 0/15 Liver: 0/14 Spleen: 4/15
> [INFO] ML: 0 control: 0
> [INFO] Delay between adventures... beep boop... 
Preference _auto_thisLoopHandleFamiliar changed from  to false
Preference choiceAdventure1387 changed from 3 to -1
Preference _auto_bad100Familiar changed from  to false

Visiting Replica Mr. Store

graceful re-entry after the deck change didn't work:

use 1 replica Libram of Resolutions

use 1 replica Smith's Tome
> Failed to pull a Breathitin
> Failed to pull a smut orc keepsake box
> [INFO] Turn(0): Starting with 40 left and 16 pulls left at Level: 1

Checklist:

  • [ x ] My code follows the style guidelines of this project.
  • [ x ] I have performed a self-review of my own code.
  • [ x ] I have commented my code, particularly in hard-to-understand areas.
  • [ x ] I have based my pull request against the main branch or have a good reason not to.

RELEASE/scripts/autoscend/paths/legacy_of_loathing.ash Outdated Show resolved Hide resolved
use(1, $item[Replica 2002 Mr. Store Catalog]); //get catalog credits
}

pullXWhenHaveY($item[Breathitin™], 1, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think breath is good enough to pull for all classes but Ed. Don't recall off hand where it is located, but there is code to handle daily activities for all classes. Move breath pull to there and make sure not ed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just using this may be a bit dangerous for all paths at the beginning of a run, because a charge will be wasted if the fight is free for some other reason and unrestricted has a ton of free kills and one of the first zones we go to is outdoors.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to level_05.ash to help with finding the encryption key

print("Failed to pull a Breathitin","red");
}

if (get_property("homebodylCharges").to_int() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a function which returns number of free crafts left. Might be able to find if ya search for other places of thos hombodylCharges prop. It would be better to pull if we don't have any free crafts.

Also would be nice to put this somewhere that gets called when we attempt to craft. As is, this is only called at start of the day. What if we run out of crafts mid day. Don't recall off hand where a good spot is

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to level_11.ash since that's the only necessary craft I can think of

}
}

if (get_property("chasmBridgeProgress").to_int() < 30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pulling keepsake box already part of the chasm quest code? Sorry on mobile so not easy to search code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't pull them atm, I also agree it would be more prudent to try and pull in level_9.ash instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a pull into level_09.ash, but left one in LoL dailies to grab one if no progress has been made on the bridge since we have dead pulls in LoL anyway

@@ -613,6 +613,7 @@ boolean chateauPainting()

boolean deck_available()
{
//return (((item_amount($item[Deck of Every Card]) > 0) && is_unrestricted($item[Deck of Every Card]) && auto_is_valid($item[Deck of Every Card])) || ((item_amount($item[Replica Deck of Every Card]) > 0) && (in_lol())));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess why it doesn't work is line 783 of mr2015 has a visit url hardcoded for the normal deck item number. Very well might be something else

@SaucedButLeaking SaucedButLeaking changed the title LoL dailies & basic 2002 catalog support LoL dailies & enabling Deck support Jun 8, 2023
@SaucedButLeaking SaucedButLeaking changed the title LoL dailies & enabling Deck support LoL dailies & enabling Deck Jun 8, 2023
Copy link
Member

@Alium58 Alium58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this! Great stuff. Have a few comments but they are all minor

use(1, $item[Homebodyl&trade;]); // get free craft charges
auto_log_info("Huffing some Homebodyl and hyperfocusing on kitchen-grade demolitions.","blue");
}
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to log when we can't pull it, can remove else statement

@@ -2205,6 +2205,19 @@ boolean L11_mauriceSpookyraven()
{
auto_log_info("Time to cook up something explosive! Science fair unstable fulminate time!", "green");
ovenHandle();
if(freeCrafts() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add this to void initializeDay(int day) in autoscend.ash as well. That way at start of day will get free crafts to catch other uses of it. I don't mind keeping it here too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are using dailyEvents() for breath's above. That could be a good spot too, I'd have to look into it more to decide which is better

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like dailyEvents() better

@@ -2205,6 +2205,19 @@ boolean L11_mauriceSpookyraven()
{
auto_log_info("Time to cook up something explosive! Science fair unstable fulminate time!", "green");
ovenHandle();
if(freeCrafts() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beyond having no free crafts, also check `auto_is_valid($item[home...]) and we have space in spleen

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a note for later, canChew() checks auto_is_valid


string deckItemId = "";
if(in_lol())
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment that this is the replica version specifically for LoL so folks know why we have this if statement

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the same comment here that you did for deck_cheat

//replica Deck id for when in Legacy of Loathing

use(1, $item[Replica 2002 Mr. Store Catalog]); //get catalog credits
}

if (get_property("chasmBridgeProgress").to_int() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be removed now that it was moved to lvl 9 code?

@@ -215,4 +219,22 @@ void auto_LegacyOfLoathingDailies()
{
use(1, $item[replica Smith\'s Tome]); // get items
}

if(item_amount($item[Replica 2002 Mr. Store Catalog]) > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also check prop _2002MrStoreCreditsCollected is false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speaking of which, would be good to update conditions above this as well if you are up for it.

_replicaSmithsTomeUsed and _replicaResolutionLibramUsed would be the prefs to check

@@ -30,6 +30,20 @@ boolean L5_getEncryptionKey()
}
}

if(!isActuallyEd())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above. Add check for canChew and remove else

@@ -210,6 +210,19 @@ void prepareForSmutOrcs()

// This adds a tonne of damage and NC progress
buffMaintain($effect[Triple-Sized]);

// pull a keepsake box if we can
pullXWhenHaveY($item[smut orc keepsake box], 1, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better in L9_chasmBuild(). It already has code to use keepsake boxes. Add the pull attempt right before that

@@ -310,6 +323,7 @@ boolean L9_chasmBuild()
visit_url("place.php?whichplace=orc_chasm&action=bridge"+(to_int(get_property("chasmBridgeProgress"))));

// use any keepsake boxes we have

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah you must have been thinking about putting it here already. This is the spot attempting to pull should go

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for moving it to here. Also delete your if statement. It is duplicate of the next line after it

Copy link
Member

@Alium58 Alium58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple more minor things, but getting close!

@@ -30,6 +30,20 @@ boolean L5_getEncryptionKey()
}
}

if(!isActuallyEd() && canChew($item[Breathitin&trade;]) && spleen_left() >= $item[Breathitin&trade;].spleen))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra paren at the very end causing checks to fail

use(1, $item[Breathitin&trade;]); // get free outdoor fight charges
auto_log_info("Huffing some Breathitin before looking for the encryption key. That's the stuff!","blue");
}
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for else

@@ -310,6 +323,7 @@ boolean L9_chasmBuild()
visit_url("place.php?whichplace=orc_chasm&action=bridge"+(to_int(get_property("chasmBridgeProgress"))));

// use any keepsake boxes we have

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for moving it to here. Also delete your if statement. It is duplicate of the next line after it


string deckItemId = "";
if(in_lol())
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the same comment here that you did for deck_cheat

//replica Deck id for when in Legacy of Loathing

@@ -1107,6 +1107,21 @@ boolean dailyEvents()
}
}

if(!isActuallyEd() && my_daycount() > 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to add canChew check for breath before pulling it

@Alium58
Copy link
Member

Alium58 commented Jul 7, 2023

Hello! It has been a few weeks. Let me know if you have questions on my comments!

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

Successfully merging this pull request may close these issues.

3 participants