Difference between revisions of "Template:Skill infobox"

From Tokyo Afterschool Summoners
Jump to navigation Jump to search
 
(93 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#css:
<includeonly><onlyinclude>{{#vardefine:skill id|{{{id|{{#if:{{{jp name|}}}|{{#masterdata:Skill|{{{jp name|}}}|id:name}}|0}}}}}}}{{#ifexpr:{{#var:skill id|}}<2|{{#vardefine:skill id|}}}}{{#if:{{#var:skill id|}}|{{
table.infobox {
#if:{{{en name|}}}|{{#vardefine:skill en name|{{{en name|}}}}}}}{{
    background-color: #f9f9f9;
#if:{{{jp name|}}}|{{#vardefine:skill jp name|{{{jp name|}}}}}}}{{
    border: 1px solid #aaa;
#if:{{{jp-en name|}}}|{{#vardefine:skill jp en name|{{{jp-en name|}}}}}}}{{
    font-size: 11px;
#masterdata:Skill|{{#var:skill id}}|{{#var:skill template options|format=wiki;list=false;args=format-table:float-true:list-false:columns=1}}
    margin: 1em 0em 1em 2em;
}}{{#vardefine:skill template options|}}|<!--Invalid invocation.-->}}</includeonly></onlyinclude>
    padding: 2px;
    text-align: center;
    width: 250px;
    float: right;
    overflow: visible;
    position: relative;
    width: 250px;
}
 
table.infobox th {
    padding: 0em 1em 0em 1em;
}
 
table.infobox tr:first-child th {
    background-color: #ccf;
    padding: 0.5em 1em 0.5em 1em;
    font-size: 1.2em;
}
 
table.infobox tr:not(:first-child) th {
    background-color: #ddf;
}
 
table.infobox tr:not(:first-child) th + th {
    background-color: #e4e4ff;
}
 
table.infobox td {
    text-align: left;
    padding: 0px 7px 0px 7px;
}
}}{{#if: <!-- define vars -->
 
{{#vardefine:skill desc|[{{Skill trigger timing|{{{jp trigger timing|}}}}}] {{#if:{{{en description|}}}|{{{en description}}}|{{{jp description|?}}}}} / {{{proc chance|0}}}%}}
 
<!-- split string at html tags (i.g. strip them) -->
{{#arraydefine:raw skill desc|{{#var:skill desc}}|/<[^>]*>/}}
 
<!-- use whitespace as delimiter -->
{{#vardefine:raw skill desc|{{#arrayprint:raw skill desc|&#32;|@@@|@@@}}}}
 
}}<!-- end define vars --><!-- create subobject
-->{{#subobject:skill{{#vardefineecho:skillnumber|{{#expr:{{#var:skillnumber|-1}}+1}}}}
| Has game context =Skill
| Has Japanese name ={{{jp name|}}}
| Has English name ={{{en name|}}}
| Has lowercase English name ={{lc:{{{en name|}}}}}
| Has Japanese description ={{{jp description|}}}
| Has English description ={{{en description|}}}
| Has skill trigger timing ={{{jp trigger timing|}}}
| Has skill proc chance ={{{proc chance|0}}}
| Has preformatted English description ={{#var:skill desc}}
| Has raw English description ={{#var:raw skill desc}}
}}<!-- end of subobject creation
--><table id="skill{{#var:staffmembernumber}}" class="infobox">
<tr>
  <th colspan="2">{{{en name|???}}}</th>
</tr>
<tr>
  <th>JP Name</th>
  <td>{{{jp name|???}}}</td>
</tr>
<tr>
  <th>Trigger timing</th>
  <td>{{Skill trigger timing|{{{jp trigger timing|?}}}}}</td>
</tr>
<tr>
  <th>Effect</th>
  <td>{{#if: {{{en description|}}}
|{{{en description}}}
|{{{jp description|?}}}
}}</td>
</tr>
<tr>
  <th>Proc Chance</th>
  <td>{{{proc chance|0}}}%</td>
</tr>
</table><!--
 
    auto categorization
 
-->{{#if: {{#ifeq: {{{categorize|y}}} | n | n }} <!-- categorize is set to don't categorize -->
      {{NAMESPACE}} <!-- don't categorize if outside namespace -->
| <!-- don't categorize -->
|
  [[Category:Skills]]
}}</includeonly><noinclude>
== Description ==
== Description ==


This templates creates a formatted string using the skill information as well as a skill subobject using the following properties:
This templates serves as a proxy between the housamo.xyz API's master data parser and the old wiki template invocations. It is not recommended to manually invoke this template, but if you absolutely must, invoke this template via: <pre>
 
{{Skill infobox
* Has game context
| jp name = In-Game Japanese name
* Has Japanese name
| jp-en name = Translated name (provided alongside en name)
* Has English name
| en name = Translated name (if not localized in-game)
* Has lowercase English name
* Has Japanese description
* Has English description
* Has skill trigger timing
* Has skill proc chance
* Has preformatted English description
* Has raw English description
 
== Usage ==
<pre>{{Skill infobox
| jp name =  
| en name =
| jp trigger timing =
| jp description =
| en description =  
| proc chance =
}}</pre>
 
=== Parameters ===
 
; jp name : Japanese name.
; en name : Translated English name.
; jp trigger timing : Activation method in Japanese without parentheses.
; jp description : Skill description in Japanese.
; en description : Translated English skill description.
; proc chance : The skill's chance to activate at skill level 1 in percent.
 
== Examples ==
 
<pre>{{Skill infobox
| jp name = 獣の末裔
| en name = Beast Descendant
| jp trigger timing = 移動後
| jp description = 自身に頑強付与
| en description = Apply {{Status effect|頑強}} to Self
| proc chance = 50
}}
}}
</pre>
</pre>
{{Skill infobox
And effects should translate over as long as a Status subobject exists on the wiki.
| jp name = 獣の末裔
| en name = Beast Descendant
| jp trigger timing = 移動後
| jp description = 自身に頑強付与
| en description = Apply {{Status effect|頑強}} to Self
| proc chance = 50
}}


[[Category:Infobox templates]] [[Category:Subobject templates]]
[[Category:Infobox templates]] [[Category:Subobject templates]][[Category:Deprecated templates]]
</noinclude>

Latest revision as of 15:26, 18 January 2019

Description

This templates serves as a proxy between the housamo.xyz API's master data parser and the old wiki template invocations. It is not recommended to manually invoke this template, but if you absolutely must, invoke this template via:

{{Skill infobox
| jp name = In-Game Japanese name
| jp-en name = Translated name (provided alongside en name)
| en name = Translated name (if not localized in-game)
}}

And effects should translate over as long as a Status subobject exists on the wiki.