-
Notifications
You must be signed in to change notification settings - Fork 72
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
track number of oyster eggs found #559
Conversation
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 Report
@@ 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
Continue to review full report at Codecov.
|
Check for |
Added the boolean check; begging for HTML now so I can write a test |
I've really gotta get a java-specific IDE
43035f7
to
b5b0149
Compare
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
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 |
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)