Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
MediaWiki help
Creopedia
Search
Search
Appearance
Log in
Personal tools
Log in
View source for Module:Ability
Module
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
←
Module:Ability
require( 'strict' ) local gameData = require( 'Module:GameData' ) local p = {} local abilityData = {} local templateArgs = {} --- Wikitext entry point for the module --- --- @param frame mw.frame --- @return string function p.main( frame ) local getArgs = require( 'Module:Arguments' ).getArgs return p._main( getArgs( frame ) ) end --- Lua entry point for the module --- --- @param args table --- @return string function p._main( args ) args = args or {} local abilityName = args.name or mw.title.getCurrentTitle().fullText abilityData = p.getData( abilityName ) templateArgs = args local wikitext = { p.renderInfobox( abilityName ), p.renderCategories( p.getCategories() ) } return table.concat( wikitext ) end --- Get the game data --- --- @param abilityName string --- @return table function p.getData( abilityName ) return gameData.getAbility( abilityName ) end --- Return the wikitext for the infobox --- --- @param abilityName string --- @return string function p.renderInfobox( abilityName ) local data = abilityData or p.getData( abilityName ) data.name = abilityName return require( 'Module:Ability/Components/Infobox' ).render( { data = data, args = templateArgs } ) end --- Get the page categories --- --- @return table function p.getCategories() local categories = { 'Abilities' } if abilityData.evocreo2 then table.insert( categories, 'Abilities in EvoCreo 2' ) end if abilityData.evocreo then table.insert( categories, 'Abilities in EvoCreo' ) end return categories end --- Return the wikitext for the category --- --- @param categories table --- @return string function p.renderCategories( categories ) local wikitext = {} for _, category in ipairs( categories ) do table.insert( wikitext, string.format( '[[Category:%s]]', category ) ) end return table.concat( wikitext, '' ) end --- Get the thumbnail for an ability --- --- @param name string --- @return string function p.getThumbnail( name ) return string.format( '%s - ability - evocreo2.png', string.lower( name ) ) end return p
Templates used on this page:
Template:Documentation
(
view source
)
Module:Ability/doc
(
view source
)
Return to
Module:Ability
.