Beispiel #1
0
 def _transform(self, data):
     data["iconPath"] = cdragon_url(data["iconPath"])
     data["cleanedDescription"] = cdragon_sanitize(data["description"])
     if data["requiredChampion"] == "":
         data["requiredChampion"] = None
     if data["requiredBuffCurrencyName"] == "":
         data["requiredBuffCurrencyName"] = "GOLD"
         data["requiredBuffCurrencyCost"] = data["price"]
     return data
Beispiel #2
0
 def _transform(self, data):
     data["squarePortraitPath"] = cdragon_url(data["squarePortraitPath"])
     data["tacticalInfo"]["damageType"] = start_k(
         data["tacticalInfo"]["damageType"])
     skins = []
     for skin in data["skins"]:
         skin["splashPath"] = cdragon_url(skin.pop("splashPath", None))
         skin["uncenteredSplashPath"] = cdragon_url(
             skin.pop("uncenteredSplashPath", None))
         skin["tilePath"] = cdragon_url(skin.pop("tilePath", None))
         skin["loadScreenPath"] = cdragon_url(
             skin.pop("loadScreenPath", None))
         skin["rarity"] = start_k(skin.pop("rarity", None))
         skin["chromaPath"] = cdragon_url(skin.pop("chromaPath", None))
         if "chromas" in skin:
             chromas = []
             for chroma in skin["chromas"]:
                 chroma["chromaPath"] = cdragon_url(
                     chroma.pop("chromaPath", None))
                 chromas.append(chroma)
             skin["chromas"] = chromas
         if skin["skinLines"] is not None:
             skin["skinLines"] = skin["skinLines"][0]["id"]
         skins.append(skin)
     data["skins"] = skins
     data["passive"]["abilityIconPath"] = cdragon_url(
         data["passive"]["abilityIconPath"])
     spells = {}
     for spell in data["spells"]:
         spell["abilityIconPath"] = cdragon_url(spell["abilityIconPath"])
         spell["cost"] = spell.pop("costCoefficients")[:5]
         spell["cooldown"] = spell.pop("cooldownCoefficients")[:5]
         spell["cleanedDescription"] = cdragon_sanitize(
             spell["dynamicDescription"])
         spell.pop("formulas", None)
         spell.pop("coefficients", None)
         spell.pop("effectAmounts", None)
         spell.pop("ammo", None)
         spell.pop("maxLevel", None)
         spells[spell["spellKey"]] = spell
     spells["p"] = data.pop("passive")
     data["spells"] = spells
     return data
Beispiel #3
0
 def cleaned_description(self) -> str:
     return cdragon_sanitize(self.long_description)