Module:Skill

local p = {}

local function newCat(catName) return  .. 'Category:' .. catName ..  end

-- actually parse the skill name here and generate categories function p.categories(frame) if not frame or not frame.args then return '' end local args = frame.args -- force skill text to lowercase to ensure easier comparisons local skill = string.lower(args[1]) -- if the skill is empty or not a string just return if not skill or skill == '' or type(skill) ~= 'string' then return '' end local cat = '' -- Score Boost 10% (with 10% or pure) if skill:find('increased by 10%%') then if skill:find('great becomes perfect') then cat = cat .. newCat('Note Boost (S) & Score Boost 10%') elseif skill:find('300 life recovery') then cat = cat .. newCat('300 Life Recovery & Score Boost 10%') elseif skill:find('will not decrease life') then cat = cat .. newCat('Damage Guard & Score Boost 10%') else cat = cat .. newCat('Score Boost 10%') end end

-- Score Boost 20% if skill:find('increased by 20%%') then if skill:find('good and higher becomes perfect') then cat = cat .. newCat('Note Boost (M) & Score Boost 20%') elseif skill:find('450 life recovery') then cat = cat .. newCat('450 Life Recovery & Score Boost 20%') end end

-- Score Boost 30% (with 30% or pure) if skill:find('increased by 30%%') then if skill:find('great becomes perfect') then cat = cat .. newCat('Note Boost (S) & Score Boost 30%') elseif skill:find('300 life recovery') then cat = cat .. newCat('300 Life Recovery & Score Boost 30%') elseif skill:find('will not decrease life') then cat = cat .. newCat('Damage Guard & Score Boost 30%') else cat = cat .. newCat('Score Boost 30%') end end

-- Score Boost 40% if skill:find('increased by 40%%') then if skill:find('bad and higher becomes perfect') then cat = cat .. newCat('Note Boost (L) & Score Boost 40%') elseif skill:find('750 life recovery') then cat = cat .. newCat('750 Life Recovery & Score Boost 40%') end end

-- Score Boost 60% (with 60% or pure) if skill:find('increased by 60%%') then if skill:find('good and higher becomes perfect') then cat = cat .. newCat('Note Boost (M) & Score Boost 60%') elseif skill:find('450 life recovery') then cat = cat .. newCat('450 Life Recovery & Score Boost 60%') else cat = cat .. newCat('Score Boost 60%') end end

if skill:find('increased by 100%%') then -- birthday skills start if skill:find('after great or lower') then cat = cat .. newCat('Score Boost 100% until GREAT or lower') .. newCat('Score Boost 40% after GREAT or lower') .. newCat('450 Life Recovery') .. newCat('Damage Guard') else cat = cat .. newCat('Score Boost 100%') end end

-- Conditional Score Boosts if skill:find('life is over 900') then if skill:find('increased by 55%%') then cat = cat .. newCat('900+ Life for Score Boost 65%') .. newCat('Score Boost 55% when less than 900 Life') end if skill:find('increased by 90%%') then cat = cat .. newCat('900+ Life for Score Boost 110%') .. newCat('Score Boost 90% when less than 900 Life') end end if skill:find('life is over 600') then if skill:find('increased by 40%%') then cat = cat .. newCat('600+ Life for Score Boost 40%') .. newCat('450 Life Recovery when less than 600 Life') end if skill:find('increased by 80%%') then cat = cat .. newCat('600+ Life for Score Boost 80%') .. newCat('500 Life Recovery when less than 600 Life') end end if skill:find('after great or lower') then if skill:find('increased by 65%%') then cat = cat .. newCat('Score Boost 65% until GREAT or lower') .. newCat('Score Boost 55% after GREAT or lower') end if skill:find('increased by 110%%') then cat = cat .. newCat('Score Boost 110% until GREAT or lower') .. newCat('Score Boost 90% after GREAT or lower') end if skill:find('same attribute') or skill:find('same type') or skill:find('powerful types') or skill:find('cool types') or skill:find('pure types') or skill:find('happy types') then cat = cat .. newCat('Same Type:Score Boost 115% until GREAT or lower') .. newCat('Score Boost 95% until GREAT or lower') .. newCat('Score Boost 80% after GREAT or lower') end end --PERFECT Only Score Boosts if skill:find('perfect notes score') then if skill:find('increased by 125%%') then if skill:find('same band') then cat = cat .. newCat('Same Band:PERFECT Only Score Boost 125%') .. newCat('PERFECT Only Score Boost 110%') else cat = cat .. newCat('PERFECT Only Score Boost 125%') .. newCat('GREAT or Less Score 0') end else cat = cat .. newCat('PERFECT Only Score Boost 120%') end end

return cat end

return p