FANDOM


(+interwiki)
第200行: 第200行:
   
 
{{reflist}}
 
{{reflist}}
<includeonly>[[Category:英雄資料模板|{{{1}}}]][[Category:{{{disp_name}}}|!]]</includeonly><noinclude>[[Category:資料模板]]</noinclude>
+
<includeonly>[[Category:英雄資料模板|{{{1}}}]][[Category:{{{disp_name}}}|!]][[de:Vorlage:Data {{{1}}}]][[en:Template:Data {{{1}}}]][[es:Plantilla:Data {{{1}}}]][[pl:Szablon:Dane/{{{1}}}]][[pt-br:Predefinição:Data {{{1}}}]]</includeonly><noinclude>[[Category:資料模板]][[de:Vorlage:Show data]][[en:Template:Champion data]][[es:Plantilla:Show data]][[pl:Szablon:Dane]][[pt-br:Predefinição:Champion data]][[ru:Шаблон:Show data]]</noinclude>
   
 
Until here the documentation is automatically generated by [[Template:Champion data]].
 
Until here the documentation is automatically generated by [[Template:Champion data]].

2017年9月27日 (三) 16:57的版本

ChampionSquare

該模板將了關於 [[{{{article|{{{disp_name}}}}}}]] 的各可獲取數據參數按照標準化的模板形式進行獲取。其他內含“Data”字段的模板可見Category:資料模板

英雄頁面

  • 頁面:
    • [[{{{disp_name}}}]]
    • [[{{{1}}}/背景故事|背景故事]]
    • [[{{{1}}}/游戏技巧|游戏技巧]]
    • [[{{{1}}}/皮肤与轶事|皮肤与轶事]]
  • 分類:
    • [[:Category:{{{1}}}|英雄分類]]
    • [[:Category:{{{1}}}皮膚|皮膚]]
    • [[:Category:{{{1}}}載入畫面|載入畫面]]
    • [[:Category:{{{1}}}配音|配音]]
    • [[:Category:{{{1}}}技能圖示|技能圖示]]
    • [[:Category:{{{1}}}技能影片|技能影片]]

參數

參數名稱備註
1{{{1}}} 模板後半部名稱[1]
article條目名稱;needs to be specified only if it differs from {{{1}}}; in applications, use [[{{{article|{{{1}}}}}}]] to link to the article (as has been done at the top of this page)
native_name英雄原始名稱,建議使用英文原文
disp_name英雄名稱建議使用中文
fullname全名
name英雄名稱建議使用英文
ms英雄移動速度
range英雄攻擊距離
attack_delayused in Riot's old code.
as_base攻擊速度基礎值
as_lvl每級攻擊速度成長值
dam_base基礎攻擊力
dam_lvl每級成長攻擊力
arm_base基礎護甲值
arm_lvl每級成長護甲值
mr_base基礎法術抗性
mr_lvl每級成長法術抗性
hp_base基礎生命值
hp_lvl每級成長生命值
mp_base基礎法力值、能量值、熱量、怒氣等
mp_lvl每級成長法力值、能量值、熱量、怒氣等
hp5_base基礎生命回复(每5秒)
hp5_lvl成長基礎回复(每5秒)
mp5_base基礎法力值、能量值回复(每5秒)
mp5_lvl成長法力值、能量值回复(每5秒)
resource英雄副血條的類型(法力、能量、怒氣等)
image英雄圖像;ChampionSquare.png
titlechampion title
herotype官方給出的英雄主要類型
alttype官方給出的英雄次要類型
rangetype攻擊距離類型(近戰或遠程)
date發行日期(yyyy年m月d日)
patch發行時的版本
changes上次更改版本
attack官方之物理攻擊值,最大值為10
health官方之防禦值,最大值為10
spells官方之技能強度值,最大值為10
difficulty官方之難度值,最大值為10
ip(由於此款遊戲分為台服和國服等兩服,所以此參數並無用途)
rp(由於此款遊戲分為台服和國服等兩服,所以此參數並無用途)
ip_tw在台服所花費的權力點
rp_tw在台服所花費的聯盟幣
ip_cn在國服所花費的金幣
rp_cn在國服所花費的點券
skill_iPlaceholderI鍵技能
skill_qPlaceholderQ鍵技能
skill_wPlaceholderW鍵技能
skill_ePlaceholderE鍵技能
skill_rPlaceholderR鍵技能

Throughout the family of templates, fixed names are used for the parameters. (The parameter names are kept short to reduce counts for the post expand include size and the template argument size in cases where these are applicable.) However, not necessarily all parameters have been given a value: some parameters may not be applicable, while for some other parameters the value may just have not been specified yet. The table shows all parameters, and for each the value, if specified.

Deprecated

The following parameters are now deprecated on the wiki.

參數名稱備註
hp1_base Base health regeneration per 1 second.
mp1_base Base resource bar regeneration per 1 second.
hp1_lvl Health regeneration per 1 second increase per level.
mp1_lvl Resource bar regeneration per 1 second increase per level

Riot provides regeneration values as per 5 seconds.

Derived data

Retrieval of data items

{{data {{{1}}}|pst2|as_base}}, using parameter selection template Template:Pst2, gives the parameter as_base, etc.

For retrieval of more data items it is more efficient to prepare a template for that, to be used as follows:

{{data {{{1}}}|template name|..|..|..|..}}

so that this data template needs to be called only once.[2] The default template is Template:Show data, producing this page.

The four parameters are optional, they are passed on to the prepared template as parameters 2-5.

A parameter being undefined or empty typically means the same, see below. {{data ..|pst2|..}} gives the empty string and the text "{{{..}}}", respectively. Therefore an application checking the parameter has to check both. Checking whether a result is equal to e.g. the text "{{{popinc}}}" cannot be done directly with #ifeq in a template which itself has also a parameter with that name, because if that is defined, there would be a comparison with the value instead of the text itself. Instead, it can be checked whether the first character of the result is "{", e.g.: {{#ifeq:{{padleft:|1|{{data {{{continent}}}|pst2|popinc}}}}|{|..|..}}.

Creating new data templates

Template:Data/preload can be used to create new data templates. The wikitext can be copied to the new data template. For parameters which are not applicable, the parameter definition can be deleted. For parameters to be filled in later the parameter definition (specifying the empty string as value) can be left in the wikitext to be filled in later. Do not forget parameter 1.

Efficiency

In this template system each template contains various properties of a single entity, as opposed to the other common system, where a template contains one property (e.g. population or area) of many entities. Although that other system can be convenient if updates of a property for all these entities become available together, in the case of large-scale use of data on one page that other system can be problematic due to its inefficiency. This is because of the following:

  • There are often more entities than properties, and page counts (or in the case of #switch, average page counts) are proportional to the number of data items in the data template (if they are stored in a linear way, not in a tree, and not stored as unnamed parameters).
  • In the case of large-scale use of data on one page there are usually one or more tables, where an entity forms a row and a property a column, because there are often more entities than properties, and because this way the sorting feature allows sorting entities based on a property. In this template system this allows producing a row with only one call of the data template, making the count not grow faster than proportional to the average number of data items stored per data template, times the number of entities in the table.

The include part of the data template of an entity does not contain a long list of its sub-entities or their properties, because that would make this method inefficient too.

  1. It may seem odd, but a template cannot retrieve its own name (PAGENAME only provides this on the template page itself), and even if it could, a string operation would be needed to remove "Data ". Putting the name of the entity in the data template removes the need to supply it as a parameter when the data template is called (in the cases that it would need this name).
  2. See the first two rows of the first table in m:Help:Array#Summary of counts for template limits.

Until here the documentation is automatically generated by Template:Champion data.


本頁面的內容引自維基百科,在知识共享许可协议下提供(檢視原作者)。 Wikipedia-logo-v2-en
除了特别提示,社区内容遵循CC-BY-SA 授权许可。