Casting Chilling Frost and Stealth skill again will not be processed and return an error instead. Fixes #12361. (#12404)

* Added logic for a repeating Chilling Frost skill. Added test case for redundant chilling frost skill cast. Added comments for the logic of repeating Stealth skill because of an error.

* Added logic for a repeating Stealth skill. Avoiding MP reduction still pending because of console error. Test cases pending.

* Completed the logic for a repeated Stealth skill. Added repeated frost skill cast check in common. Removed exclusive test. Test cases are pending.

* Added test case for Stealth skill recast. Fixed lint errors. Fixed a flaw in if statement which led to test case failure.

* Fixed lint errors in test case.

* Added a common JSON entry for skil recasts in three files. Other files remaining. Added Chilling Frost recast check in common code. Modified test cases.

* Added spellDisabled condition in client code.

* Reverted JSON messages for three languages. Added spellAlreadyCast attribute to JSON file in locales/en. Made changes for showing appropriate message in client code.

* Added an import for throwing BadRequest in common code. Modified test case accordingly.

* Update website/common/script/content/spells.js

Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>

* Added target and req attributes in cast() method arguments.

* Changed common code test case because of increased function parameters. Moved chilling frost test casse to common tests instead of server tests.

* Changed the test case format in common tests.

* Added a missing done statement.

* Fixed a minor error which led to failing test case. Removed the exclusive test which led to lint error.

* Fixed lint errors.

* Added a class named 'disabled' for the frontend change.

* fix(skills): style cleanup

* fix(skills): unfix

Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
This commit is contained in:
Jalansh
2020-08-09 21:55:59 +05:30
committed by GitHub
parent d7d7f82723
commit c0bf2cffea
6 changed files with 72 additions and 17 deletions
+12 -9
View File
@@ -42,12 +42,14 @@
:key="key"
v-b-popover.hover.auto="skillNotes(skill)"
class="col-12 col-md-3"
@click="castStart(skill)"
@click="!spellDisabled(key) ? castStart(skill) : null"
>
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
<div class="spell col-12 row">
<div
class="spell col-12 row"
:class="{'disabled': spellDisabled(key)}"
>
<div class="col-8 details">
<a :class="{'disabled': spellDisabled(key)}"></a>
<div
class="img"
:class="`shop_${skill.key} shop-sprite item-img`"
@@ -88,9 +90,6 @@
}
}
.drawer-container {
}
.drawer-slider {
margin-top: 1em;
}
@@ -100,7 +99,7 @@
white-space: initial;
}
.spell:hover {
.spell:hover:not(.disabled) {
cursor: pointer;
border: solid 2px #50b5e9;
}
@@ -116,6 +115,10 @@
padding-left: 0;
overflow: hidden;
&.disabled {
opacity: 0.5;
}
.details {
text-align: left;
padding-top: .5em;
@@ -280,9 +283,9 @@ export default {
let notes = skill.notes();
if (skill.key === 'frost' && this.spellDisabled(skill.key)) {
notes = this.$t('spellWizardFrostAlreadyCast');
notes = this.$t('spellAlreadyCast');
} else if (skill.key === 'stealth' && this.spellDisabled(skill.key)) {
notes = this.$t('spellRogueStealthMaxedOut');
notes = this.$t('spellAlreadyCast');
} else if (skill.key === 'stealth') {
notes = this.$t('spellRogueStealthDaliesAvoided', {
originalText: notes,