-
Notifications
You must be signed in to change notification settings - Fork 14
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
Obsidian Weapons gear bonus #70 #99
base: master
Are you sure you want to change the base?
Conversation
* calc: Add Obsidian gear and berserker necklace bonus * test: Add tests for obsidian gear bonus
* calc: Avoid applying obsidian gear bonus when manually casting * test: Added a test to enforce this
* test: Convert spaces to tabs. Remove redundant noinspection directives
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #99 +/- ##
=======================================
Coverage 99% 99%
- Complexity 480 501 +21
=======================================
Files 76 78 +2
Lines 1436 1473 +37
Branches 137 145 +8
=======================================
+ Hits 1423 1460 +37
Partials 13 13
☔ View full report in Codecov by Sentry. |
return OBSIDIAN_WEAPONS.contains(context.get(equipmentItemIdsComputable).get(EquipmentInventorySlot.WEAPON)) && | ||
!castingSpell; | ||
} | ||
catch (DpsComputeException e) |
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.
Don't catch DpsComputeExceptions during the compute flow.
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.
Fair enough, I added this in anticipation of null spells as in the other PR so it can be removed without complaint.
* calc : Remove try-catch from ObsidianGearBonus which anticipated null spells
src/main/java/com/duckblade/osrs/dpscalc/calc/DpsComputeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/duckblade/osrs/dpscalc/calc/gearbonus/ObsidianGearBonus.java
Outdated
Show resolved
Hide resolved
src/main/java/com/duckblade/osrs/dpscalc/calc/gearbonus/ObsidianGearBonus.java
Outdated
Show resolved
Hide resolved
src/main/java/com/duckblade/osrs/dpscalc/calc/gearbonus/ObsidianGearBonus.java
Outdated
Show resolved
Hide resolved
{ | ||
// Note: Wiki is unclear if the damage bonuses are additive or multiplicative. | ||
// It's a difference between multipliers of 1.3 and 1.32 - difficult to spot. | ||
return GearBonuses.of(1.1, 1.1 * preArmourDamage); |
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 are multiplicative with integer truncation in the middle, although the integer truncation behaviour needs to be changed in GearBonusComputable.
As long as you change the two bonuses to be in separate classes, this will automatically be done.
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.
As long as you change the two bonuses to be in separate classes, this will automatically be done.
Will do,
although the integer truncation behaviour needs to be changed in GearBonusComputable.
A note on that front. I'm looking at #82 and #78 on one of my local branches.
As you seem to be aware, currently gear bonuses are aggregated naively without any considerations for integer truncation. This is part of the reason for the plugin's inaccuracy as seen in these issues. AggregateGearBonusesComputable will have to go, or otherwise mutate into some Set or whatever.
There's also another problem, wherein the salve amulet and elite void mage set aren't actually applied as a gear bonus for magic damage, it's actually like an additive 20%/2.5% increase (respectively) to the magic damage bonus.
These two otherwise benefit from remaining under the GearBonus structure. However keeping them under there means GearBonuses can no longer remain anonymous as far as whatever new aggregator will be concerned, as these two specific bonuses require special treatment. I was thinking of adding a basic ID field with each GearBonus assigned an integer in a separate file (GearBonusID), but this is pretty horrible and I'm probably missing the forest for the trees, it's an inelegant solution but it would work for resolving the second problem. The slayer helm and tomes still behave like normal GearBonuses for the purposes of magic - it's just the salve amulet / void set that misbehave.
Sorry for the mountains of text, your thoughts?
PS: I'm fine to keep our conversations here, but I'm open to moving elsewhere if it's more convenient for you.
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.
There's also another problem, wherein the salve amulet and elite void mage set aren't actually applied as a gear bonus for magic damage, it's actually like an additive 20%/2.5% increase (respectively) to the magic damage bonus.
Do you have a source on this? Are all magic damage effects applied as such? (e.g. smoke battlestaff? which seems to be one of the least documented damage bonuses)
These two otherwise benefit from remaining under the GearBonus structure [...snip]
If they're uniquely applied relative to other GearBonuses, it'll be good to set up a StatsBonus system that modifies the player stats before going into bonuses. The Tumeken's Shadow effect is implemented poorly but would be able to be rolled in properly to that.
PS: I'm fine to keep our conversations here, but I'm open to moving elsewhere if it's more convenient for you.
Discord is easier (LlemonDuck#3306), but I'll probably forget to reply sometimes there so for discussion like this we can use Discord, and for code that's actually been written let's keep it on GH.
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.
Do you have a source on this? Are all magic damage effects applied as such? (e.g. smoke battlestaff? which seems to be one of the least documented damage bonuses)
My source is the holy grail that everyone seems to agree is correct, it's used by the existing spreadsheets afaik:
https://web.archive.org/web/20190905124128/http://webcache.googleusercontent.com/search?q=cache:http://services.runescape.com/m=forum/forums.ws?317,318,712,65587452
I found it by checking the references on this wiki page:
https://oldschool.runescape.wiki/w/Maximum_magic_hit
Personally in terms of in-game verification, I can't check the smoke battlestaff (ironman btw ;), but I'd be inclined to believe this forum post which states it's a magic damage bonus. The salve amulet however I've seen for myself is certainly a magic damage bonus. Void mage is even more transparent as it shows as a magic damage bonus in the equipment UI in-game. I'm pretty sure as I say that slayer helms and tomes still work with truncation after their effects.
If you have a bonded account with a smoke battlestaff, you could confirm by casting fire surge with a tormented bracelet, imbued god cape, and smoke battlestaff of course, on a POH dummy. If it's a gear bonus, it will be int(int(24 * 1.07) * 1.1)
= 27. If it's added to magic bonus, it will be int(24*1.17)
= 28.
If they're uniquely applied relative to other GearBonuses, it'll be good to set up a StatsBonus system that modifies the player stats before going into bonuses. The Tumeken's Shadow effect is implemented poorly but would be able to be rolled in properly to that.
That does sound like it could be more elegant, I'll look into that when I have time.
* calc: Separate berserker necklace bonus from obsidian armour * test: Adjust tests accordingly
…ace are all-or-nothing, move the check for these items into isApplicable * test : Adjust tests accordingly for the above
I felt I ought to move the checks for the besrker necklace / obsidian armour into |
Closes #70, #92