FANDOM


-- <nowiki>
--
-- Implements [[Template:Ability clickpic]]
--
 
local p = {}
 
local abilities = {
	['slice'] = {},
	['havoc'] = {},
	['backhand'] = {},
	['smash'] = {},
	['barge'] = {},
	['sever'] = {},
	['slaughter'] = {},
	['flurry'] = {},
	['hurricane'] = {},
	['blood tendrils'] = {},
	['forceful backhand'] = {},
	['overpower'] = {},
	['massacre'] = {},
	['meteor strike'] = {},
	['balanced strike'] = {},
	['kick'] = {},
	['punish'] = {},
	['dismember'] = {},
	['fury'] = {},
	['cleave'] = {},
	['decimate'] = {},
	['destroy'] = {image = 'Destroy (ability)'},
	['quake'] = {},
	['assault'] = {},
	['stomp'] = {},
	['berserk'] = {},
	['pulverise'] = {},
	['frenzy'] = {},
	['anticipation'] = {},
	['bash'] = {},
	['provoke'] = {},
	['freedom'] = {},
	['resonance'] = {},
	['preparation'] = {},
	['revenge'] = {},
	['reflect'] = {},
	['debilitate'] = {},
	['devotion'] = {},
	['immortality'] = {},
	['rejuvenate'] = {},
	['barricade'] = {},
	['natural instinct'] = {},
	['sacrifice'] = {},
	['regenerate'] = {image = 'Regenerate (ability)'},
	['momentum'] = {image = 'Momentum (ability)'},
	['incite'] = {},
	['single-way wilderness'] = {},
	['guthix\'s blessing'] = {},
	['transfigure'] = {},
	['balanced stance'] = {},
	['defensive stance'] = {},
	['aggressive stance'] = {},
	['reckless stance'] = {},
	['piercing shot'] = {},
	['snipe'] = {},
	['dazing shot'] = {},
	['needle strike'] = {},
	['binding shot'] = {},
	['fragmentation shot'] = {},
	['escape'] = {},
	['ricochet'] = {},
	['snap shot'] = {},
	['rapid fire'] = {},
	['bombardment'] = {},
	['shadow tendrils'] = {},
	['tight bindings'] = {},
	['deadshot'] = {},
	['incendiary shot'] = {},
	['unload'] = {},
	['death\'s swiftness'] = {},
	['wrack'] = {},
	['dragon breath'] = {},
	['sonic wave'] = {},
	['concentrated blast'] = {},
	['impact'] = {},
	['combust'] = {},
	['surge'] = {},
	['chain'] = {},
	['asphyxiate'] = {},
	['detonate'] = {},
	['wild magic'] = {},
	['smoke tendrils'] = {},
	['deep impact'] = {},
	['omnipower'] = {},
	['metamorphosis'] = {},
	['tsunami'] = {},
	['sunshine'] = {},
	['shatter'] = {},
	['storm shards'] = {},
	['corruption blast'] = {},
	['corruption shot'] = {},
	['onslaught'] = {},
	['demoralise'] = {},
	['tuska\'s wrath'] = {},
	['reprisal'] = {},
	['mutated dazing shot'] = {},
	['salt the wound'] = {},
	['bladed dive'] = {}
}
 
function p.titleCase( first, rest )
   return first:upper()..rest:lower()
end
 
function p.name(name)
    return string.gsub(" "..name, "%s%l", string.upper):sub(2)
end
 
function p.main(frame)
	local args = frame:getParent().args
	local params = {}
	for i, q in ipairs(args) do
		if abilities[q:lower()] ~= nil then
			table.insert(params,q:lower())
		end
	end
 
	return p._main(params)
end
 
function p._main(params)
	local ret = mw.html.create('span')
				:addClass('clickpic')
	local _text = {}
	for i, v in ipairs(params) do
	    if abilities[v].image ~= nil then
		    table.insert(_text,string.format('[[File:%s.png|link=%s]]',abilities[v].image,p.name(v)))
		else
			table.insert(_text,string.format('[[File:%s.png|link=%s]]',p.name(v),p.name(v)))
        end
	end
	_text = table.concat(_text,'')
 
	ret:wikitext(_text)
	return ret
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.