system update with "Conjured" items

This commit is contained in:
thiwanka-aux 2021-09-20 18:06:29 +05:30
parent 5416470dbe
commit 30c4d62ea7

View File

@ -21,7 +21,10 @@ export class GildedRose {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].name != 'Aged Brie' && this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name === 'Conjured') {
const updatedQuality = this.items[i].quality - 2
this.items[i].quality = updatedQuality < 0 ? 0 : updatedQuality
} else if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
}
}
@ -49,7 +52,10 @@ export class GildedRose {
if (this.items[i].name != 'Aged Brie') {
if (this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name === 'Conjured') {
const updatedQuality = this.items[i].quality - 2
this.items[i].quality = updatedQuality < 0 ? 0 : updatedQuality
} else if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
}
}