GREEN: implement conjured items degrading twice as fast
This commit is contained in:
parent
13f6bc231f
commit
4d436517e7
1 changed files with 17 additions and 0 deletions
|
|
@ -93,6 +93,21 @@ class SulfurasUpdater implements ItemUpdater {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ConjuredItemUpdater implements ItemUpdater {
|
||||||
|
@override
|
||||||
|
void update(Item item) {
|
||||||
|
// Conjured items degrade twice as fast as normal items
|
||||||
|
_degradeQuality(item, 2);
|
||||||
|
|
||||||
|
item.sellIn -= 1;
|
||||||
|
|
||||||
|
// After sell-by date, quality degrades twice as fast (4x total)
|
||||||
|
if (item.sellIn < 0) {
|
||||||
|
_degradeQuality(item, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class GildedRose {
|
class GildedRose {
|
||||||
List<Item> items;
|
List<Item> items;
|
||||||
|
|
||||||
|
|
@ -112,6 +127,8 @@ class GildedRose {
|
||||||
return AgedBrieUpdater();
|
return AgedBrieUpdater();
|
||||||
} else if (item.name == 'Backstage passes to a TAFKAL80ETC concert') {
|
} else if (item.name == 'Backstage passes to a TAFKAL80ETC concert') {
|
||||||
return BackstagePassUpdater();
|
return BackstagePassUpdater();
|
||||||
|
} else if (item.name.startsWith('Conjured')) {
|
||||||
|
return ConjuredItemUpdater();
|
||||||
} else {
|
} else {
|
||||||
return NormalItemUpdater();
|
return NormalItemUpdater();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue