Issue 12220 stealth tooltip show protected dailies (#12255)

* Issue 12220 - Show dailies protected by Stealth

A feature on the old site showed the number of
dailies protected by casting Stealth. This is
now showing again in the Stealth tooltip. The
skillNotes section was not being called. It
adds additional skill-specific info: the dailies
avoided by stealth, whether stealth no longer
needs to be cast (dailies already avoided) and
whether frost is no longer useful to cast.

Speculation: the spellDisabled method had some
commented out code regarding Stealth, which
may have broken due to a change in how dailies
are referenced. I have fixed this line, so it
seemed alright to keep the entirety of the
skillNotes function as it had been. However,
this includes more than just showing dailies
in the tooltip.

Behavior changes:
- tooltip shows dailies avoided for Stealth
- tooltip shows maxed out message for
Stealth when all dailies are covered
- tooltip shows frost already cast message
when frost has already been cast

* clean up conditions in skillNotes

* use future tense for rogue stealth dailies tooltip

* use getter for accurate task length

* consider stealth disabled based on incomplete dailies due, not all dailies

* Issue 12220 - Show dailies protected by Stealth

A feature on the old site showed the number of
dailies protected by casting Stealth. This is
now showing again in the Stealth tooltip. The
skillNotes section was not being called. It
adds additional skill-specific info: the dailies
avoided by stealth, whether stealth no longer
needs to be cast (dailies already avoided) and
whether frost is no longer useful to cast.

Speculation: the spellDisabled method had some
commented out code regarding Stealth, which
may have broken due to a change in how dailies
are referenced. I have fixed this line, so it
seemed alright to keep the entirety of the
skillNotes function as it had been. However,
this includes more than just showing dailies
in the tooltip.

Behavior changes:
- tooltip shows dailies avoided for Stealth
- tooltip shows maxed out message for
Stealth when all dailies are covered
- tooltip shows frost already cast message
when frost has already been cast

* factor out stealthBuffsToAdd for casting stealth + tooltip previewing dailies avoided

* fix merge conflict
This commit is contained in:
Alexandrea Beh
2020-06-29 02:12:19 -07:00
committed by GitHub
parent 911a44adec
commit da60f44356
3 changed files with 18 additions and 17 deletions

View File

@@ -40,7 +40,7 @@
v-for="(skill, key) in spells[user.stats.class]" v-for="(skill, key) in spells[user.stats.class]"
v-if="user.stats.lvl >= skill.lvl" v-if="user.stats.lvl >= skill.lvl"
:key="key" :key="key"
v-b-popover.hover.auto="skill.notes()" v-b-popover.hover.auto="skillNotes(skill)"
class="col-12 col-md-3" class="col-12 col-md-3"
@click="castStart(skill)" @click="castStart(skill)"
> >
@@ -204,9 +204,9 @@
</style> </style>
<script> <script>
import spells from '@/../../common/script/content/spells'; import spells, { stealthBuffsToAdd } from '@/../../common/script/content/spells';
import { mapState } from '@/libs/store'; import { mapState, mapGetters } from '@/libs/store';
import notifications from '@/mixins/notifications'; import notifications from '@/mixins/notifications';
import spellsMixin from '@/mixins/spells'; import spellsMixin from '@/mixins/spells';
import Drawer from '@/components/ui/drawer'; import Drawer from '@/components/ui/drawer';
@@ -237,6 +237,9 @@ export default {
}, },
computed: { computed: {
...mapState({ user: 'user.data' }), ...mapState({ user: 'user.data' }),
...mapGetters({
getUnfilteredTaskList: 'tasks:getUnfilteredTaskList',
}),
openStatus () { openStatus () {
return this.$store.state.spellOptions.spellDrawOpen ? 1 : 0; return this.$store.state.spellOptions.spellDrawOpen ? 1 : 0;
}, },
@@ -267,18 +270,12 @@ export default {
); );
}, },
spellDisabled (skill) { spellDisabled (skill) {
if (skill === 'frost' && this.user.stats.buffs.streaks) { const incompleteDailiesDue = this.getUnfilteredTaskList('daily').filter(daily => !daily.completed && daily.isDue).length;
return true; if (skill === 'frost' && this.user.stats.buffs.streaks) return true;
} if (skill === 'stealth' && this.user.stats.buffs.stealth >= incompleteDailiesDue) return true;
// @TODO: Implement
// } else if (skill === 'stealth' && this.user.stats.buffs.stealth
// >= this.user.dailys.length) {
// return true;
// }
return false; return false;
}, },
// @TODO is this used?
skillNotes (skill) { skillNotes (skill) {
let notes = skill.notes(); let notes = skill.notes();
@@ -289,7 +286,7 @@ export default {
} else if (skill.key === 'stealth') { } else if (skill.key === 'stealth') {
notes = this.$t('spellRogueStealthDaliesAvoided', { notes = this.$t('spellRogueStealthDaliesAvoided', {
originalText: notes, originalText: notes,
number: this.user.stats.buffs.stealth, number: stealthBuffsToAdd(this.user),
}); });
} }

View File

@@ -36,7 +36,7 @@
"spellRogueStealthText": "Stealth", "spellRogueStealthText": "Stealth",
"spellRogueStealthNotes": "With each cast, a few of your undone Dailies won't cause damage tonight. Their streaks and colors won't change. (Based on: PER)", "spellRogueStealthNotes": "With each cast, a few of your undone Dailies won't cause damage tonight. Their streaks and colors won't change. (Based on: PER)",
"spellRogueStealthDaliesAvoided": "<%= originalText %> Number of dailies avoided: <%= number %>.", "spellRogueStealthDaliesAvoided": "<%= originalText %> Number of dailies that will be avoided: <%= number %>.",
"spellRogueStealthMaxedOut": "You have already avoided all your dailies; there's no need to cast this again.", "spellRogueStealthMaxedOut": "You have already avoided all your dailies; there's no need to cast this again.",
"spellHealerHealText": "Healing Light", "spellHealerHealText": "Healing Light",

View File

@@ -45,6 +45,12 @@ function calculateBonus (value, stat, critVal = 1, statScale = 0.5) {
return (value < 0 ? 1 : value + 1) + stat * statScale * critVal; return (value < 0 ? 1 : value + 1) + stat * statScale * critVal;
} }
export function stealthBuffsToAdd (user) {
return Math.ceil(diminishingReturns(
statsComputed(user).per, user.tasksOrder.dailys.length * 0.64, 55,
));
}
const spells = {}; const spells = {};
spells.wizard = { spells.wizard = {
@@ -208,9 +214,7 @@ spells.rogue = {
notes: t('spellRogueStealthNotes'), notes: t('spellRogueStealthNotes'),
cast (user) { cast (user) {
if (!user.stats.buffs.stealth) user.stats.buffs.stealth = 0; if (!user.stats.buffs.stealth) user.stats.buffs.stealth = 0;
user.stats.buffs.stealth += Math.ceil(diminishingReturns( user.stats.buffs.stealth += stealthBuffsToAdd(user);
statsComputed(user).per, user.tasksOrder.dailys.length * 0.64, 55,
));
}, },
}, },
}; };