|
|
Line 1: |
Line 1: |
− | -- <pre>
| + | {{Duel Links card |
− | -- @name Data
| + | | image = SpawnAlligator-DULI-EN-VG.png |
− | -- @description Interface for Module:Database.
| + | | ja_image = SpawnAlligator-DULI-JP-VG.png |
− | -- @notes Internal-only, so far.
| + | | attribute = WATER |
− | -- @author [[User:Becasita]]
| + | | types = Reptile / Effect |
− | -- @contact [[User talk:Becasita]]
| + | | atk = 2200 |
− | | + | | def = 1000 |
− | -------------------
| + | | level = 5 |
− | -- Export variable:
| + | | rarity = R |
− | -------------------
| + | | effect_types = Trigger |
− | local D = {};
| + | | lore = During the [[End Phase]] of the [[turn]] this card was [[Tribute Summon]]ed by [[Tributing]] a [[Reptile]]-[[Type]] [[Monster Card|monster]]: [[Target]] 1 monster that was used for the Tribute Summon of this card; [[Special Summon]] it from the [[Graveyard]]. |
− | | + | | ja_lore = 爬虫類族モンスターをリリースしてこのカードがアドバンス召喚したターンのエンドフェイズ時、このカードのアドバンス召喚のためにリリースしたモンスター1体を墓地から選択して自分フィールド上に特殊召喚する。 |
− | --------------
| + | | releases = |
− | -- Load data:
| + | {{Duel Links release table/header}} |
− | --------------
| + | {{Duel Links release table|type=box|Generation Next (Duel Links set)}} |
− | local DATA = mw.loadData( 'Module:Database' );
| + | {{Duel Links release table/footer}} |
− | | + | }} |
− | ----------------------
| |
− | -- Internal functions:
| |
− | ----------------------
| |
− | -- @name normalize
| |
− | -- @description Normalize the input.
| |
− | local function normalize( arg )
| |
− | return type( arg ) == 'string'
| |
− | and mw.text.trim( arg ):lower()
| |
− | :gsub( ' rare$', '' ) -- Remove " rare" at the end (and with a space before it).
| |
− | :gsub( ' ', '' ) -- Remove spaces.
| |
− | :gsub( '%-', '' ) -- Remove dashes.
| |
− | :gsub( '/', '' ) -- Remove slashes.
| |
− | :gsub( ':', '' ) -- Remove semi-colon.
| |
− | :gsub( '!', '' ) -- Remove exclamation mark.
| |
− | :gsub( "'", '' ) -- Remove apostrophe.
| |
− | :gsub( 'the', '' ) -- Remove "the". CAREFUL here. TODO: Split this function by type of data.
| |
− | :gsub( 'north', '' ) -- Remove "north".
| |
− | :gsub( 'edition', '' ) -- Remove "edition".
| |
− | :gsub( 'ygo', '' )
| |
− | :gsub( 'yugioh', '' )
| |
− | or nil
| |
− | ;
| |
− | end
| |
− | | |
− | -----------
| |
− | -- Methods:
| |
− | -----------
| |
− | -- @name getRg
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Region index.
| |
− | -- @description Gets the region index for «arg». «nil» if not found.
| |
− | function D.getRg( arg )
| |
− | return DATA.rg[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getRegion
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Region name.
| |
− | -- @description Gets the region name for «arg». «nil» if not found.
| |
− | function D.getRegion( arg )
| |
− | return DATA.region[ D.getRg( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getLn
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Language index.
| |
− | -- @description Gets the language index for «arg». «nil» if not found.
| |
− | function D.getLn( arg )
| |
− | return DATA.ln[ D.getRg( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getLanguage
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Language name.
| |
− | -- @description Gets the language name for «arg». «nil» if not found.
| |
− | function D.getLanguage( arg )
| |
− | return DATA.language[ D.getLn( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getEd
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Edition abbreviation.
| |
− | -- @description Gets the edition abbreviation for «arg». «nil» if not found.
| |
− | function D.getEd( arg )
| |
− | return DATA.ed[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getEdition | |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Edition name.
| |
− | -- @description Gets the edition name for «arg». «nil» if not found.
| |
− | function D.getEdition( arg )
| |
− | return DATA.edition[ D.getEd( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getRel
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Release abbreviation.
| |
− | -- @description Gets the release abbreviation for «arg». «nil» if not found.
| |
− | function D.getRel( arg )
| |
− | return DATA.rel[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getRelease
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Release name.
| |
− | -- @description Gets the release name for «arg». «nil» if not found.
| |
− | function D.getRelease( arg )
| |
− | return DATA.release[ D.getRel( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getAnimeMangaRel
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Anime and manga release abbreviation.
| |
− | -- @description Gets the anime and manga release abbreviation for «arg». «nil» if not found.
| |
− | function D.getAnimeMangaRel( arg )
| |
− | return DATA.amRel[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getAnimeMangaRelease
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Anime and manga release name.
| |
− | -- @description Gets the anime and manga release name for «arg». «nil» if not found.
| |
− | function D.getAnimeMangaRelease( arg )
| |
− | return DATA.amRelease[ D.getAnimeMangaRel( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getR
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Rarity abbreviation.
| |
− | -- @description Gets the rarity abbreviation for «arg». «nil» if not found.
| |
− | function D.getR( arg )
| |
− | return DATA.r[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getRarity
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Rarity name.
| |
− | -- @description Gets the rarity name for «arg». «nil» if not found.
| |
− | function D.getRarity( arg )
| |
− | return DATA.rarity[ D.getR( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getAnimeS
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Anime series code.
| |
− | -- @description Gets the anime series code for «arg». «nil» if not found.
| |
− | function D.getAnimeS( arg )
| |
− | return DATA.s.anime[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getAnimeSeries
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Anime series name.
| |
− | -- @description Gets the anime series name for «arg». «nil» if not found.
| |
− | function D.getAnimeSeries( arg )
| |
− | return DATA.series.anime[ D.getAnimeS( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getMangaS
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Manga series code.
| |
− | -- @description Gets the manga series code for «arg». «nil» if not found.
| |
− | function D.getMangaS( arg )
| |
− | return DATA.s.manga[ normalize( arg ) ];
| |
− | end
| |
− | | |
− | -- @name getMangaSeries
| |
− | -- @parameter {string} «arg»
| |
− | -- @return {string|nil} Manga series name.
| |
− | -- @description Gets the manga series name for «arg». «nil» if not found.
| |
− | function D.getMangaSeries( arg )
| |
− | return DATA.series.manga[ D.getMangaS( arg ) ];
| |
− | end
| |
− | | |
− | ----------
| |
− | -- Return:
| |
− | ----------
| |
− | return D;
| |
− | -- </pre>
| |