From 24c56931bfab8ab4c1d864a15163520d8381f3e1 Mon Sep 17 00:00:00 2001 From: Yarramsetti Naresh Date: Sun, 6 Apr 2025 17:52:27 +0530 Subject: [PATCH] 3. Implement Conjured items support: Added update_conjured_item method that: Degrades quality twice per day (calls decrease_quality twice) Respects same quality bounds as normal items Modified dispatcher to detect "Conjured" in item names Enhanced expired item handling: Double degradation continues post-sell-by Added explicit condition before Sulfuras check Maintained all existing behavior through test verification --- python/gilded_rose.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/gilded_rose.py b/python/gilded_rose.py index e5027c21..bc5f99ae 100755 --- a/python/gilded_rose.py +++ b/python/gilded_rose.py @@ -16,9 +16,15 @@ class GildedRose(object): self.update_aged_brie(item) elif item.name == "Backstage passes to a TAFKAL80ETC concert": self.update_backstage_pass(item) + elif "Conjured" in item.name: + self.update_conjured_item(item) elif item.name != "Sulfuras, Hand of Ragnaros": self.update_normal_item(item) + def update_conjured_item(self, item): + self.decrease_quality(item) + self.decrease_quality(item) + def update_sell_in(self, item): if item.name != "Sulfuras, Hand of Ragnaros": item.sell_in -= 1 @@ -28,6 +34,9 @@ class GildedRose(object): self.increase_quality(item) elif item.name == "Backstage passes to a TAFKAL80ETC concert": item.quality = 0 + elif "Conjured" in item.name: + self.decrease_quality(item) + self.decrease_quality(item) elif item.name != "Sulfuras, Hand of Ragnaros": self.decrease_quality(item)