Home
Random
Log in
Settings
About the Honkai: Nexus Anima Wiki
Disclaimers
Search
Editing
Module
:
Shared VA
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local Parse = require('Module:Parser').getTemplateArgs local lib = require('Module:Feature') local lang_dict = { ["EN"] = "English", ["CN"] = "Chinese", ["JP"] = "Japanese", ["KR"] = "Korean", } local games_dict = { ["hna"] = nil, ["hi3"] = "Honkai Impact 3rd", ["hg2"] = "Houkai Gakuen 2", ["hsr"] = "Honkai: Star Rail", ["gi"] = "Genshin Impact", ["zzz"] = "Zenless Zone Zero", ["pp"] = "Petit Planet", ["tot"] = "Tears of Themis", } local iw_links = { ["hna"] = "[[%s|%s]]", ["hi3"] = "[https://honkaiimpact3.fandom.com/wiki/%s %s]", ["hg2"] = "[https://houkai2nd.fandom.com/wiki/%s %s]", ["hsr"] = "[https://honkai-star-rail.fandom.com/wiki/%s %s]", ["gi"] = "[https://genshin-impact.fandom.com/wiki/%s %s]", ["zzz"] = "[https://zenless-zone-zero.fandom.com/wiki/%s %s]", ["pp"] = "[https://petitplanet.wiki/%s %s]", ["tot"] = "[https://tot.wiki/wiki/%s %s]", } local game_order = {'hna', 'hi3', 'hg2', 'hsr', 'gi', 'zzz', 'pp', 'tot'} local lang_order = {'EN', 'CN', 'JP', 'KR'} function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { parentFirst = true }) if (lib.isEmpty(args['char'])) then args['char'] = mw.title.getCurrentTitle().rootText end return p._main(args, frame) end function p._main(args, frame) local VAs = {character = args['char']} local data = Parse(args['char'], {only='Character Infobox'}) or {} local out = mw.html.create('ul') for _, lang in ipairs(lang_order) do -- Language's VA name local va = data['va'..lang] or '' VAs[lang] = { VA = args['va'..lang] or (lib.isNotEmpty(va) and frame:preprocess(lib.trim( VAs.character=='Protagonist' and (va:gsub('^.-F: (.-)<r?b?.-M: (.+)$', '%1 or %2'):gsub('%s*<ref.+$', '')) or (va:gsub('%s*<ref.+$', '')) )) ) or '<i>Unknown</i>', games = {} } -- Parse the characters from each game for _, game in ipairs(game_order) do local chars = lib.split(args[game .. lang] or '', ';', {removeEmpty = true}) if #chars>0 then table.insert(VAs[lang].games, game) VAs[lang][game] = VAs[lang][game] or mw.html.create() for i, ch in ipairs(chars) do if i > 1 and #chars > 2 then VAs[lang][game]:wikitext(', ') end if i > 1 and i==#chars then VAs[lang][game]:wikitext(' and ') end local characterName, note = ch:match('(.+)\\(.+)') VAs[lang][game]:wikitext(string.format(iw_links[game], mw.uri.encode(characterName or ch, 'WIKI'), characterName or ch)) if (lib.isNotEmpty(note)) then VAs[lang][game]:wikitext(" ''(", note, ")''") end end if games_dict[game] ~= nil then VAs[lang][game]:wikitext(' in '):tag('i'):wikitext(games_dict[game]) end end end if #VAs[lang].games>0 then local li = out:tag('li') li:wikitext(VAs.character, ' shares the same ', lang_dict[lang], ' voice actor, ', VAs[lang].VA, ', with') if #VAs[lang].games==1 then li :wikitext(' ') :node(VAs[lang][VAs[lang].games[1]]) :wikitext('.') else li:wikitext(':') local liul = li:tag('ul') -- Render the list for i, game in ipairs(game_order) do if VAs[lang][game] then liul:tag('li'):node(VAs[lang][game]) end end end end end return out end return p
Summary:
Please note that all contributions to Honkai: Nexus Anima Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Honkai Nexus Anima Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
Dynamic Page List
:
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
:
¹
^2{
}^2
^2{¹}^2
Parser Functions
:
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup:
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices:
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder Image|}}
Magic Words
:
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
References:
<ref></ref>
{{Reflist}}
{{Ref/Arti|}}
{{Ref/ArtiSet|}}
{{Ref/BB|}}
{{Ref/Book|}}
{{Ref/CS|}}
{{Ref/Companion|}}
{{Ref/Domain|}}
{{Ref/Enemy|}}
{{Ref/Food|}}
{{Ref/Furnishing|}}
{{Ref/HEO|}}
{{Ref/Item|}}
{{Ref/Loading|}}
{{Ref/Location|}}
{{Ref/Manga|}}
{{Ref/NPC|}}
{{Ref/Outfit|}}
{{Ref/Quest|}}
{{Ref/Talent|}}
{{Ref/VO|}}
{{Ref/VP|}}
{{Ref/Weapon|}}
{{Ref/Wildlife|}}
HTML Entities:
—
,
­
Page included on this page:
Module:Shared VA/doc
(
view source
)