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

track number of oyster eggs found #559

Merged
merged 15 commits into from
Feb 4, 2022

Conversation

horrible-little-slime
Copy link
Contributor

Per the wiki, the probability of finding an oyster egg exponentially decreases by the number of eggs you've found; this adds tracking for the number of oyster eggs encountered, (although not their location)

@horrible-little-slime horrible-little-slime requested a review from a team as a code owner January 30, 2022 03:10
@horrible-little-slime horrible-little-slime marked this pull request as draft January 30, 2022 03:13
@horrible-little-slime
Copy link
Contributor Author

Drafting this because I've discovered you can encounter eggs outside of combat, and I'm not entirely sure where to move the code if that's the case.

@codecov
Copy link

codecov bot commented Jan 30, 2022

Codecov Report

Merging #559 (2ff3ba1) into main (0f38ae1) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #559   +/-   ##
=========================================
  Coverage     20.37%   20.37%           
- Complexity     8599     8602    +3     
=========================================
  Files           998      998           
  Lines        156002   156006    +4     
  Branches      34706    34708    +2     
=========================================
+ Hits          31792    31794    +2     
- Misses       118291   118292    +1     
- Partials       5919     5920    +1     
Impacted Files Coverage Δ
.../net/sourceforge/kolmafia/objectpool/ItemPool.java 14.28% <ø> (ø)
.../sourceforge/kolmafia/session/ResultProcessor.java 16.41% <66.66%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f38ae1...2ff3ba1. Read the comment docs.

@horrible-little-slime horrible-little-slime changed the title track number of oyster eggs found in combat track number of oyster eggs found Jan 30, 2022
@horrible-little-slime horrible-little-slime marked this pull request as ready for review January 30, 2022 17:10
@gausie
Copy link
Contributor

gausie commented Jan 30, 2022

Check for adventureResults boolean and add some tests please!

@horrible-little-slime
Copy link
Contributor Author

Check for adventureResults boolean and add some tests please!

Added the boolean check; begging for HTML now so I can write a test

Copy link
Contributor

@gausie gausie left a comment

Choose a reason for hiding this comment

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

Awaiting that test

import net.sourceforge.kolmafia.preferences.Preferences;

public class OysterEggTest {
public void OysterEggObtainingTest() {
Copy link
Contributor

Choose a reason for hiding this comment

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

These should go in ResultProcessorTest


public class OysterEggTest {
public void OysterEggObtainingTest() {
KoLCharacter.reset("the Tristero");
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this, add a @BeforeEach to the class that runs KoLCharacter.reset(<className>) and Preferences.reset()`. I started using the class name for a username because it limits any unexpected statefullness to that single class.

public void OysterEggObtainingTest() {
KoLCharacter.reset("the Tristero");
ResultProcessor.processResult(new AdventureResult("magnificent oyster egg", 1));
assertEquals(Preferences.getInteger("_oysterEggsFound"), 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be three separate tests imo

@horrible-little-slime
Copy link
Contributor Author

horrible-little-slime commented Feb 3, 2022

Wrote the test, ran into some issues. Cannot seem to get it to think that it's Oyster Egg Day. Pushing it with the failing test so as to milk every last drop of wisdom from each of you.

Edit: there is egg on my face and I'm getting knuckle tattoos on both hands that say FOOL

@jaadams5 jaadams5 merged commit 331c7ff into kolmafia:main Feb 4, 2022
@horrible-little-slime horrible-little-slime deleted the oyster-egg-tracking branch February 4, 2022 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants