meraki-analytics / lolstaticdata

Accurate League of Legends static data for champions and items
MIT License
63 stars 22 forks source link

What is the intended way to read/parse item effects? #62

Open TwoWaffles opened 1 year ago

TwoWaffles commented 1 year ago

Hi, I have been working with the item data for a project. I wanted to display item data as they show it in game in a human readable way, but I have no idea how to understand the way the effects are written. I see that they are taken from the lolwiki and stuff like {{pp|<>}} are templates from the wiki as shown here: https://leagueoflegends.fandom.com/wiki/Doran%27s_Shield?action=edit.

For example, this is one of Doran's Shields effect: "After taking damage from a [[champion]] or large [[monster]], gain [[health regeneration]] equal to {{pp|0 to 40 for 11|type='''current missing''' health|color=health|key1=%|0 to 75|formula=0.53 health regen for every 1% missing health}} health over 8 seconds. Reduced to{{ft|66% effectiveness|{{pp|0 to 26.4 for 11|type='''current missing''' health|color=health|key1=%|0 to 75|formula=0.35 health regen for every 1% missing health}}}} on {{tip|ranged}} champions or when triggered by [[area of effect]], [[damage over time]], or [[damage|proc]]."

For stuff inside of [[ ]] I can quite easily remove these, but for the {{pp }} or {{ft }} I am unsure what a smart/efficient way is to remove these for all the effect descriptions or if it is even possible.

Thank you.

DanyYanev commented 1 year ago

This is quite an old issue but the syntax inside items is the standard way in wikis - https://en.wikipedia.org/wiki/Help:Template

How you style that syntax I'm not sure. I wrote my own parser and renderer by just checking all this custom syntax on the wiki.