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

gift packages. checkitems #1860

Merged
merged 2 commits into from
Jul 29, 2023
Merged

gift packages. checkitems #1860

merged 2 commits into from
Jul 29, 2023

Conversation

Veracity0
Copy link
Contributor

  1. New attribute: "gift package" items are now "usable, package"
  2. When you open a gift package, we print who it's from.
    Now, we print that before processing results.
  3. I added support for the "package" attribute in DebugModifiers
  4. I ran "checkitems" and "checkpowers" and fixed a bunch of items.

I got NPEs on a bunch of items in checkModifiers because modifiers.txt contained a value for a modifier but when we parsed it, we got a null. As it happened, it was always the Thorns modifier.
I suspect it is because we have 2 patterns for it (3, now, since I found another one), and only one has a numeric value that we parse.

We actually do a bad value of parsing the number, since KoL expresses it as a range - and often has an element associated with it.

Here is a bunch of errors that checkitems now prints when it detects something like that.
Everything that says "missing a value" caused an NPE.

It looks like both Thorns and Damage Aura should actually have an Element.

# *** modifier Damage Aura: 1 should be Damage Aura: Cold Damage
Item	chiffon chapeau	Experience (Muscle): +2, Spooky Damage: +10, Spooky Spell Damage: +10, Damage Aura: Cold Damage
# *** modifier Thorns: [env(underwater)] missing a value
Item	eelskin hat	Spell Damage Percent: +15, Thorns, Familiar Effect: "atk"
# *** modifier Thorns: 1 missing a value
Item	marble mariachi hat	Monster Level: +10, Ranged Damage Percent: +30, Thorns
# *** modifier Thorns: 1 should be Thorns: 30-45 damage
Item	parasitic headgnawer	Thorns: 30-45 damage, Familiar Effect: "atk, cap 7"
# *** modifier Damage Aura: 1 should be Damage Aura: Spooky Damage
Item	chiffon chaps	Experience (Moxie): +2, Hot Damage: +10, Hot Spell Damage: +10, Damage Aura: Spooky Damage
# *** modifier Damage Aura: 1 should be Damage Aura: <font color=purple>Sleaze Damage</font>
Item	dubious loincloth	Damage Aura: <font color=purple>Sleaze Damage</font>, Familiar Effect: "atk, 1.5xVolley"
# *** modifier Thorns: [env(underwater)] missing a value
Item	eelskin pants	Mysticality Percent: +5, Thorns, Familiar Effect: "1xPotato, MP regen"
# *** modifier Thorns: 1 missing a value
Item	marble maebari	Muscle Percent: +20, Sleaze Damage: +20, Thorns
# *** modifier Damage Aura: 1 should be Damage Aura: <font color=green>Stench Damage</font>
Item	muddy skirt	Damage Aura: <font color=green>Stench Damage</font>, Familiar Effect: "sleaze atk, 1xFairy"
# *** modifier Thorns: 1 missing a value
Item	SMOOCH codpiece	Damage Reduction: 5, Damage Absorption: +20, Thorns, Familiar Effect: "atk, 1xBarrr, cap 20"
# *** modifier Damage Aura: 1 should be Damage Aura: Sleaze Damage
Item	chiffon chemise	Experience (Mysticality): +2, Cold Damage: +10, Cold Spell Damage: +10, Damage Aura: Sleaze Damage
# *** modifier Thorns: 1 missing a value
Item	SMOOCH breastplate	Damage Absorption: +40, Thorns
# *** modifier Damage Aura: 1 should be Damage Aura: damage
Item	chiffon chakram	Moxie: +10, Stench Damage: +10, Stench Spell Damage: +10, Damage Aura: damage
# *** modifier Thorns: 1 should be Thorns: 2-3 damage
Item	balloon shield	Thorns: 2-3 damage, Damage Reduction: 3
# *** modifier Damage Aura: 1 should be Damage Aura: Stench Damage
Item	chiffon chamberpot	Mysticality: +10, Sleaze Damage: +10, Sleaze Spell Damage: +10, Damage Aura: Stench Damage
# *** modifier Damage Aura: 1 should be Damage Aura: 10-20 cold damage
# double-ice box: All Spells Cast Are Cold
# *** modifier Thorns: [env(underwater)] missing a value
Item	eelskin shield	Maximum HP: +55, Maximum MP: +55, Thorns, Damage Reduction: 13
# *** modifier Damage Aura: 1 should be Damage Aura: <font color=green>Stench Damage</font>
Item	Grey Guanon	Stench Damage: +5, Damage Aura: <font color=green>Stench Damage</font>
# *** modifier Thorns: 1 missing a value
Item	hot plate	Hot Damage: +3, Thorns, Damage Reduction: 3
# *** modifier Damage Aura: 1 should be Damage Aura: Cold Damage
Item	jar of frostigkraut	Cold Damage: +10, Damage Aura: Cold Damage
# *** modifier Thorns: 1 missing a value
Item	marble mignonette bowl	MP Regen Min: 4, MP Regen Max: 8, Cold Spell Damage: +40, Thorns
# *** modifier Thorns: 1 should be Thorns: 40-50 <font color=red>Hot Damage</font>
Item	Ol' Scratch's stove door	Hot Damage: +20, Thorns: 40-50 <font color=red>Hot Damage</font>, Damage Reduction: 15
# *** modifier Thorns: 1 should be Thorns: 40-50 <font color=green>Stench Damage</font>
Item	Oscus's garbage can lid	Stench Damage: +20, Thorns: 40-50 <font color=green>Stench Damage</font>, Damage Reduction: 15
# *** modifier Damage Aura: 1 should be Damage Aura: 13 <font color=gray>Spooky Damage</font> to your enemies
Item	rubber baby doll	Damage Aura: 13 <font color=gray>Spooky Damage</font> to your enemies
# *** modifier Damage Aura: 1 should be Damage Aura: <font color=gray>Spooky Damage</font>
Item	smirking shrunken head	Damage Aura: <font color=gray>Spooky Damage</font>
# *** modifier Thorns: 1 should be Thorns: 80-100 <font color=green>Stench Damage</font>
Item	tailbone shield	Stench Damage: +40, Thorns: 80-100 <font color=green>Stench Damage</font>, Damage Reduction: 16
# *** modifier Thorns: 1 should be Thorns: damage
Item	Unkillable Skeleton's shield	Spooky Resistance: +3, Stench Resistance: +3, Hot Resistance: +3, Cold Resistance: +3, Sleaze Resistance: +3, Maximum MP: -300, Thorns: damage, Damage Reduction: 23
# *** modifier Thorns: 1 missing a value
Item	acid-squirting flower	Thorns, Single Equip
# *** new enchantment: Thorns seen
Item	bottle opener belt buckle	Thorns, Single Equip, Damage Aura: 1
# *** new enchantment: Thorns: a rainbow of damage seen
Item	groovy prism necklace	Thorns: a rainbow of damage, Single Equip, Sporadic Thorns: 2.5
# *** modifier Thorns: 1 missing a value
Item	hippy protest button	Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	ironic oversized sunglasses	Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	marble magnet	Mysticality Percent: +20, Spell Damage Percent: +30, Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	marble medallion	Moxie Percent: +20, Spooky Resistance: +5, Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	SMOOCH bracers	Damage Reduction: 5, Damage Absorption: +15, Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	SMOOCH kneepads	Damage Reduction: 10, Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	SMOOCH spaulders	Damage Absorption: +25, Thorns, Single Equip
# *** modifier Thorns: 2 missing a value
Item	spiky turtle shoulderpads	Damage Absorption: +75, Thorns, Single Equip
# *** modifier Thorns: 1 missing a value
Item	marble mantle	Damage Reduction: 10, Weapon Damage Percent: +30, Thorns
# *** modifier Damage Aura: 1 should be Damage Aura: physical damage
Item	shocked shell	Damage Aura: physical damage, Class: "Turtle Tamer"
# *** new enchantment: Damage Aura: <font color=green>Stench Damage</font> seen
Item	bag of gross foreign snacks	Damage Aura: <font color=green>Stench Damage</font>
# *** new enchantment: Damage Aura: Physical Damage seen
# broken BRICKO brick: (deals more damage if you use additional ones)
Item	broken BRICKO brick	Damage Aura: Physical Damage
# *** new enchantment: Damage Aura: 15-20 <font color=red>Hot Damage</font> and 10-20 more seen
Item	can of sterno	Damage Aura: 15-20 <font color=red>Hot Damage</font> and 10-20 more
# *** new enchantment: Damage Aura: <font color=gray>Spooky Damage</font> seen
Item	crazy hobo notebook	Damage Aura: <font color=gray>Spooky Damage</font>
# *** new enchantment: Damage Aura: Physical Damage seen
Item	electric boning knife	Damage Aura: Physical Damage
# *** modifier Damage Aura: 1 should be Damage Aura: <font color=green>Stench Damage</font>
Item	folder (Stinky Trash Kid)	Damage Aura: <font color=green>Stench Damage</font>
# *** new enchantment: Damage Aura: <font color=red>Hot Damage</font> seen
Item	murderbot live wire	Damage Aura: <font color=red>Hot Damage</font>
# *** new enchantment: Damage Aura: <font color=blueviolet>Sleaze Damage</font> seen
Item	nastygeist	Damage Aura: <font color=blueviolet>Sleaze Damage</font>
# *** new enchantment: Damage Aura: Physical Damage seen
Item	small golem	Damage Aura: Physical Damage

@Veracity0 Veracity0 requested a review from a team as a code owner July 28, 2023 20:03
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #1860 (422a397) into main (bc0246c) will increase coverage by 0.00%.
The diff coverage is 69.23%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1860   +/-   ##
=========================================
  Coverage     36.32%   36.33%           
- Complexity    18757    18762    +5     
=========================================
  Files          1081     1081           
  Lines        166332   166346   +14     
  Branches      35391    35394    +3     
=========================================
+ Hits          60424    60442   +18     
+ Misses        96032    96026    -6     
- Partials       9876     9878    +2     
Files Changed Coverage Δ
...ourceforge/kolmafia/persistence/DebugDatabase.java 11.79% <0.00%> (-0.03%) ⬇️
...sourceforge/kolmafia/modifiers/DoubleModifier.java 94.50% <80.00%> (+0.02%) ⬆️
...t/sourceforge/kolmafia/request/UseItemRequest.java 16.96% <91.66%> (+0.37%) ⬆️
...sourceforge/kolmafia/persistence/ItemDatabase.java 48.38% <100.00%> (+0.10%) ⬆️
...t/sourceforge/kolmafia/request/GenericRequest.java 35.16% <100.00%> (+0.17%) ⬆️

Continue to review full report in Codecov by Sentry.

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

@Veracity0
Copy link
Contributor Author

bottle opener belt buckle: Damages Attacking Opponent
Item	bottle opener belt buckle	Single Equip, Damage Aura: 1

vs.

hippy protest button: Damages Attacking Opponent
Item	hippy protest button	Single Equip, Thorns: 1

What is the difference between "Damage Aura" and "Thorns"?

chiffon chapeau: Deals Cold Damage each round
Item	chiffon chapeau	Experience (Muscle): +2, Spooky Damage: +10, Spooky Spell Damage: +10, Damage Aura: 1

Damage Aura. I guess? Doesn't require opponent to hit you?

tailbone shield: Deals 80-100 [Stench Damage] to attackers
Item	tailbone shield	Stench Damage: +40, Damage Reduction: 16, Thorns: 1

Is that only when they attack (not stunned) and actually hit you?

In any case, it seems like Thorns and Damage Aura both need an element.
Perhaps Thorns needs a range - although many examples don't give a numeric value.

I think those two modifiers need some work.

@midgleyc
Copy link
Member

midgleyc commented Jul 28, 2023

Thorns and Damage Aura are intended to be used for Frosty or the Wall of Skin -- bosses where you care about how many sources of damage you have, but not how much damage they do, or of what element. And also the wall of bones, where you care about /not/ having any passive damage sources.

Thorns is when the enemy hits you, damage aura is when they don't need to hit you.

They're both working as I intended. For example, if you add numeric damage, groovy prism necklace is 5 of each element for 25 total and cannonball charrrm bracelet is 27.5 hot, but for the wall of skin / Frosty the prism necklace is much better due to the damage cap.

They were added in #1624.

@Veracity0
Copy link
Contributor Author

Veracity0 commented Jul 29, 2023

Ok. It's news to me that a bottle opener belt buckle does not operate the same way as a hippy protest button, but considering I have never used either, I am no expert.

Interesting that they have the identical "Enchantment" text in the item description, but that you end up with one or the other of two different Modifiers - and you have to look at the Wiki in order to figure out which one it is.

I think that's a first for us.

There is still a bug with DebugDatabase not being able to parse Thorns correctly, but I'm not going to spend more time flailing at that; not throwing an NPE is good enough for now.

I plan no more new content for this PR.

@Veracity0 Veracity0 merged commit 5e6e8be into main Jul 29, 2023
8 checks passed
@Veracity0 Veracity0 deleted the gift-packages-checkitems branch July 29, 2023 12:28
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